From 3ceb4c5c7a98882dd9a896532525bd3cea694cef Mon Sep 17 00:00:00 2001 From: Orgad Shaneh Date: Mon, 30 Jan 2017 22:51:40 +0200 Subject: [PATCH] Git: Fix result check on reset Choosing Discard on Pull, when there are uncommitted changes, fails when it tries to execute git reset --hard. This broke in ca7a924a068b23815e3915b1f2887eed0e38ef7f: if (!rc) was replaced by if (resp.result == Finished). Change-Id: I19e080ee08eb52bf2156da7c27ade4b77cf2ece0 Reviewed-by: Eike Ziller Reviewed-by: Tobias Hunger --- src/plugins/git/gitclient.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index a7aa1b8064a..3b1afc91954 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1104,7 +1104,7 @@ bool GitClient::synchronousReset(const QString &workingDirectory, // Note that git exits with 1 even if the operation is successful // Assume real failure if the output does not contain "foo.cpp modified" // or "Unstaged changes after reset" (git 1.7.0). - if (resp.result == SynchronousProcessResponse::Finished + if (resp.result != SynchronousProcessResponse::Finished && (!stdOut.contains("modified") && !stdOut.contains("Unstaged changes after reset"))) { if (files.isEmpty()) { msgCannotRun(arguments, workingDirectory, resp.stdErr(), errorMessage);