Commit 3ceb4c5c authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

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 ca7a924a:
if (!rc) was replaced by if (resp.result == Finished).

Change-Id: I19e080ee08eb52bf2156da7c27ade4b77cf2ece0
Reviewed-by: Eike Ziller's avatarEike Ziller <>
Reviewed-by: Tobias Hunger's avatarTobias Hunger <>
parent 4db0b7aa
......@@ -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);
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment