forked from qt-creator/qt-creator
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 ca7a924a06
:
if (!rc) was replaced by if (resp.result == Finished).
Change-Id: I19e080ee08eb52bf2156da7c27ade4b77cf2ece0
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
4db0b7aa2e
commit
3ceb4c5c7a
@@ -1104,7 +1104,7 @@ bool GitClient::synchronousReset(const QString &workingDirectory,
|
|||||||
// Note that git exits with 1 even if the operation is successful
|
// Note that git exits with 1 even if the operation is successful
|
||||||
// Assume real failure if the output does not contain "foo.cpp modified"
|
// Assume real failure if the output does not contain "foo.cpp modified"
|
||||||
// or "Unstaged changes after reset" (git 1.7.0).
|
// 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"))) {
|
&& (!stdOut.contains("modified") && !stdOut.contains("Unstaged changes after reset"))) {
|
||||||
if (files.isEmpty()) {
|
if (files.isEmpty()) {
|
||||||
msgCannotRun(arguments, workingDirectory, resp.stdErr(), errorMessage);
|
msgCannotRun(arguments, workingDirectory, resp.stdErr(), errorMessage);
|
||||||
|
Reference in New Issue
Block a user