diff --git a/src/libs/utils/shellcommand.cpp b/src/libs/utils/shellcommand.cpp index 92d97dc65b4..0d5be90996e 100644 --- a/src/libs/utils/shellcommand.cpp +++ b/src/libs/utils/shellcommand.cpp @@ -338,10 +338,13 @@ SynchronousProcessResponse ShellCommand::runCommand(const FileName &binary, if (!(d->m_flags & SuppressCommandLogging)) proxy->appendCommand(dir, binary, arguments); - if (d->m_flags & FullySynchronously || QThread::currentThread() == QCoreApplication::instance()->thread()) + if ((d->m_flags & FullySynchronously) + || (!(d->m_flags & NoFullySync) + && QThread::currentThread() == QCoreApplication::instance()->thread())) { response = runFullySynchronous(binary, arguments, proxy, timeoutS, dir, interpreter); - else + } else { response = runSynchronous(binary, arguments, proxy, timeoutS, dir, interpreter); + } if (!d->m_aborted) { // Success/Fail message in appropriate window? diff --git a/src/libs/utils/shellcommand.h b/src/libs/utils/shellcommand.h index c1bdb5a785d..22ff4a8df29 100644 --- a/src/libs/utils/shellcommand.h +++ b/src/libs/utils/shellcommand.h @@ -101,6 +101,7 @@ public: FullySynchronously = 0x80, // Suppress local event loop (in case UI actions are // triggered by file watchers). SilentOutput = 0x100, // Suppress user notifications about the output happening. + NoFullySync = 0x200, // Avoid fully synchronous execution even in UI thread. NoOutput = SuppressStdErr | SuppressFailMessage | SuppressCommandLogging }; diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index ad7cd7ca177..56577ffd8d2 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -2721,7 +2721,8 @@ bool GitClient::addAndCommit(const QString &repositoryDirectory, arguments << "--signoff"; } - const SynchronousProcessResponse resp = vcsFullySynchronousExec(repositoryDirectory, arguments); + const SynchronousProcessResponse resp = vcsSynchronousExec(repositoryDirectory, arguments, + VcsCommand::NoFullySync); const QString stdErr = resp.stdErr(); if (resp.result == SynchronousProcessResponse::Finished) { VcsOutputWindow::appendMessage(msgCommitted(amendSHA1, commitCount));