diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2016-02-06 21:48:02 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2016-02-08 08:07:58 +0000 |
commit | 5db0ef191ebd2b6db0c4e583f2ad001842257316 (patch) | |
tree | 57a3b55666882921460ed954f441f0a5e28006d5 /src/plugins/git/gitgrep.cpp | |
parent | 9117b28eb1c3790a05a434579b1ea2c45ce4e027 (diff) |
Git: Do not report canceled for Grep when no results were found
Change-Id: Ib1916c345bd345ee3dd5179c84bb259c2992303e
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
Diffstat (limited to 'src/plugins/git/gitgrep.cpp')
-rw-r--r-- | src/plugins/git/gitgrep.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/plugins/git/gitgrep.cpp b/src/plugins/git/gitgrep.cpp index f0fd31eb34a..a1c54f7700d 100644 --- a/src/plugins/git/gitgrep.cpp +++ b/src/plugins/git/gitgrep.cpp @@ -144,8 +144,18 @@ public: command.data(), &VcsCommand::cancel); connect(command.data(), &VcsCommand::stdOutText, this, &GitGrepRunner::read); SynchronousProcessResponse resp = command->runCommand(client->vcsBinary(), arguments, 0); - if (resp.result != SynchronousProcessResponse::Finished) + switch (resp.result) { + case SynchronousProcessResponse::TerminatedAbnormally: + case SynchronousProcessResponse::StartFailed: + case SynchronousProcessResponse::Hang: m_fi.reportCanceled(); + break; + case SynchronousProcessResponse::Finished: + case SynchronousProcessResponse::FinishedError: + // When no results are found, git-grep exits with non-zero status. + // Do not consider this as an error. + break; + } } static void run(QFutureInterface<FileSearchResultList> &fi, |