From 84b57027c838712ea2e28efd8641a6427d90e08a Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 1 Oct 2017 12:32:54 +0300 Subject: [PATCH] Git: Fix progress during rebase Broke by c4b50488362. Change-Id: I35b22b6ab5fd8767ef729906b8344a0d6aa1f0cf Reviewed-by: Tobias Hunger --- src/plugins/git/gitclient.cpp | 13 +++++++------ src/plugins/git/gitclient.h | 4 +++- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 8deea9816d8..f2cdc4750d1 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -2863,8 +2863,7 @@ bool GitClient::canRebase(const QString &workingDirectory) const void GitClient::rebase(const QString &workingDirectory, const QString &argument) { - VcsCommand *command = vcsExecAbortable(workingDirectory, {"rebase", argument}); - GitProgressParser::attachToCommand(command); + vcsExecAbortable(workingDirectory, {"rebase", argument}, true); } void GitClient::cherryPick(const QString &workingDirectory, const QString &argument) @@ -2880,7 +2879,8 @@ void GitClient::revert(const QString &workingDirectory, const QString &argument) // Executes a command asynchronously. Work tree is expected to be clean. // Stashing is handled prior to this call. VcsCommand *GitClient::vcsExecAbortable(const QString &workingDirectory, - const QStringList &arguments) + const QStringList &arguments, + bool createProgressParser) { QTC_ASSERT(!arguments.isEmpty(), return nullptr); @@ -2890,8 +2890,10 @@ VcsCommand *GitClient::vcsExecAbortable(const QString &workingDirectory, command->setCookie(workingDirectory); command->addFlags(VcsCommand::ShowSuccessMessage); command->addJob(vcsBinary(), arguments, 0); - command->execute(); ConflictHandler::attachToCommand(command, abortCommand); + if (createProgressParser) + GitProgressParser::attachToCommand(command); + command->execute(); return command; } @@ -2929,8 +2931,7 @@ void GitClient::interactiveRebase(const QString &workingDirectory, const QString arguments << commit + '^'; if (fixup) m_disableEditor = true; - VcsCommand *command = vcsExecAbortable(workingDirectory, arguments); - GitProgressParser::attachToCommand(command); + vcsExecAbortable(workingDirectory, arguments, true); if (fixup) m_disableEditor = false; } diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 92988be65da..7d26709c40d 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -124,7 +124,9 @@ public: Utils::FileName vcsBinary() const override; unsigned gitVersion(QString *errorMessage = nullptr) const; - VcsBase::VcsCommand *vcsExecAbortable(const QString &workingDirectory, const QStringList &arguments); + VcsBase::VcsCommand *vcsExecAbortable(const QString &workingDirectory, + const QStringList &arguments, + bool createProgressParser = false); QString findRepositoryForDirectory(const QString &dir) const; QString findGitDirForRepository(const QString &repositoryDir) const;