From b4698f0b67aaefc2d90c3886b4102ed710af0768 Mon Sep 17 00:00:00 2001 From: woblight Date: Sat, 23 Jun 2018 20:02:48 +0200 Subject: [PATCH] Fix rename on clone --- control.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/control.cpp b/control.cpp index f0f0375..55dc7a7 100644 --- a/control.cpp +++ b/control.cpp @@ -209,10 +209,13 @@ void Control::clone(QUrl url) QStringList toc = dir.entryList({"*.toc"}); if (toc.isEmpty()) { } else if (toc[0].toLower() != dir.dirName().toLower() + ".toc") { + git_repository_free(data.repo); dir.cdUp(); QString newName = toc[0].chopped(4); dir.rename(data.name, newName); data.name = newName; + dir.cd(data.name); + git_repository_open(&data.repo, dir.canonicalPath().toLocal8Bit()); } return data; },[this](auto ret){