diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2018-06-26 07:58:04 +0300 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2018-06-27 09:43:47 +0000 |
commit | b82ffb917b914411962213ca9ff6412e0551a46b (patch) | |
tree | 4408d0e399f6e54e8a7891b23ef92a30bfa4e14d /src/plugins/vcsbase | |
parent | caff9f9aacd5190b1e067a2ca0a56a14f2fe6996 (diff) | |
download | qt-creator-b82ffb917b914411962213ca9ff6412e0551a46b.tar.gz |
VcsCommand: Block auto reload while a command is running
Git rebase is executed in the background, and it can change a file multiple
times in a short period. If we reparse a file while this happens on
Windows, Git fails to replace it, the rebase action fails and the
repository becomes unstable (remains with a modified file).
See discussion at https://github.com/git-for-windows/git/pull/1666
Task-number: QTCREATORBUG-15449
Change-Id: Iba40a770a1df2dfff0dd1c874c491dfbe1cceb58
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Diffstat (limited to 'src/plugins/vcsbase')
-rw-r--r-- | src/plugins/vcsbase/vcscommand.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/plugins/vcsbase/vcscommand.cpp b/src/plugins/vcsbase/vcscommand.cpp index cf10769711..26db328083 100644 --- a/src/plugins/vcsbase/vcscommand.cpp +++ b/src/plugins/vcsbase/vcscommand.cpp @@ -27,6 +27,7 @@ #include "vcsbaseplugin.h" #include "vcsoutputwindow.h" +#include <coreplugin/documentmanager.h> #include <coreplugin/vcsmanager.h> #include <utils/synchronousprocess.h> @@ -56,6 +57,14 @@ VcsCommand::VcsCommand(const QString &workingDirectory, return proxy; }); + connect(this, &VcsCommand::started, this, [this] { + if (flags() & ExpectRepoChanges) + Core::DocumentManager::setAutoReloadPostponed(true); + }); + connect(this, &VcsCommand::finished, this, [this] { + if (flags() & ExpectRepoChanges) + Core::DocumentManager::setAutoReloadPostponed(false); + }); } const QProcessEnvironment VcsCommand::processEnvironment() const |