diff --git a/src/GitProcessThread.cpp b/src/GitProcessThread.cpp index 485d64a9..b1ea5c26 100644 --- a/src/GitProcessThread.cpp +++ b/src/GitProcessThread.cpp @@ -120,6 +120,7 @@ GitCommandItem_fetch::GitCommandItem_fetch(const QString &progress_message, bool : AbstractGitCommandItem(progress_message) , prune(prune) { + after_operation = Reopen; update_commit_log = true; } diff --git a/src/GitProcessThread.h b/src/GitProcessThread.h index 8631364b..d31dc521 100644 --- a/src/GitProcessThread.h +++ b/src/GitProcessThread.h @@ -15,7 +15,12 @@ class AbstractGitCommandItem { PtyProcess *pty = nullptr; QString progress_message; bool update_commit_log = false; - bool reopen_repository = true; + enum AfterOperation { + None, + Fetch, + Reopen, + }; + AfterOperation after_operation = Fetch; AbstractGitCommandItem(QString const &progress_message) : progress_message(progress_message) { diff --git a/src/MainWindow.cpp b/src/MainWindow.cpp index 24ccc4ea..6cb386c8 100644 --- a/src/MainWindow.cpp +++ b/src/MainWindow.cpp @@ -1816,10 +1816,18 @@ void MainWindow::onPtyFetchCompleted(ProcessStatus const &status, QVariant const GitProcessRequest const &req = userdata.value(); Q_ASSERT(req.params); - if (req.params->reopen_repository) { + switch (req.params->after_operation) { + case AbstractGitCommandItem::Reopen: internalOpenRepository(git(), false, false); - } else if (req.params->update_commit_log) { - openRepositoryMain(frame(), git(), false, false, false, true); + break; + case AbstractGitCommandItem::Fetch: + fetch(git(), false); + break; + default: + if (req.params->update_commit_log) { + openRepositoryMain(frame(), git(), false, false, false, true); + } + break; } }