Git: Do not report canceled for Grep when no results were found

Change-Id: Ib1916c345bd345ee3dd5179c84bb259c2992303e
Reviewed-by: Eike Ziller <eike.ziller@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2016-02-06 21:48:02 +02:00
committed by Orgad Shaneh
parent 9117b28eb1
commit 5db0ef191e

View File

@@ -144,8 +144,18 @@ public:
command.data(), &VcsCommand::cancel); command.data(), &VcsCommand::cancel);
connect(command.data(), &VcsCommand::stdOutText, this, &GitGrepRunner::read); connect(command.data(), &VcsCommand::stdOutText, this, &GitGrepRunner::read);
SynchronousProcessResponse resp = command->runCommand(client->vcsBinary(), arguments, 0); 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(); 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, static void run(QFutureInterface<FileSearchResultList> &fi,