Fix rename on clone
This commit is contained in:
@@ -209,10 +209,13 @@ void Control::clone(QUrl url)
|
|||||||
QStringList toc = dir.entryList({"*.toc"});
|
QStringList toc = dir.entryList({"*.toc"});
|
||||||
if (toc.isEmpty()) {
|
if (toc.isEmpty()) {
|
||||||
} else if (toc[0].toLower() != dir.dirName().toLower() + ".toc") {
|
} else if (toc[0].toLower() != dir.dirName().toLower() + ".toc") {
|
||||||
|
git_repository_free(data.repo);
|
||||||
dir.cdUp();
|
dir.cdUp();
|
||||||
QString newName = toc[0].chopped(4);
|
QString newName = toc[0].chopped(4);
|
||||||
dir.rename(data.name, newName);
|
dir.rename(data.name, newName);
|
||||||
data.name = newName;
|
data.name = newName;
|
||||||
|
dir.cd(data.name);
|
||||||
|
git_repository_open(&data.repo, dir.canonicalPath().toLocal8Bit());
|
||||||
}
|
}
|
||||||
return data;
|
return data;
|
||||||
},[this](auto ret){
|
},[this](auto ret){
|
||||||
|
|||||||
Reference in New Issue
Block a user