From 2a1154870377d17aa4150fdfb490e5a4df0cb2a6 Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Sun, 21 Jun 2015 23:36:06 +0300 Subject: [PATCH] Git: Fix Stash & Pop for synchronous actions After a successful Cherry-Pick or Revert, a ConflictHandler needs be instantiated in order to call endStashScope. This was broken in b6608d0d3. Change-Id: I2e828fa87695b9ac9972fca569e473b5f63abfec Reviewed-by: Tobias Hunger --- src/plugins/git/gitclient.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index 8e29f4012bc..762e056f7f6 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -485,6 +485,9 @@ public: const QString &abortCommand = QString()) { ConflictHandler handler(workingDirectory, abortCommand); + // No conflicts => do nothing + if (response.result == SynchronousProcessResponse::Finished) + return; handler.readStdOut(response.stdOut); handler.readStdErr(response.stdErr); } @@ -2750,10 +2753,8 @@ bool GitClient::executeAndHandleConflicts(const QString &workingDirectory, | VcsCommand::ShowSuccessMessage; const SynchronousProcessResponse resp = vcsSynchronousExec(workingDirectory, arguments, flags); // Notify about changed files or abort the rebase. - const bool ok = resp.result == SynchronousProcessResponse::Finished; - if (!ok) - ConflictHandler::handleResponse(resp, workingDirectory, abortCommand); - return ok; + ConflictHandler::handleResponse(resp, workingDirectory, abortCommand); + return resp.result == SynchronousProcessResponse::Finished; } bool GitClient::synchronousPull(const QString &workingDirectory, bool rebase)