forked from qt-creator/qt-creator
VcsCommand: Fix clearing repository
Move a call to setRepository() from c'tor into the setup() method, as it should be called just before the process is started. Add an accompanying call to clearRepository() into the cleanup() method. Remove other manual calls to setRepository() and clearRepository(). Change-Id: I35b9d4ea72cc885bb8ae34950987a8ca18584fd1 Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
@@ -90,12 +90,14 @@ int VcsCommandPrivate::timeoutS() const
|
||||
|
||||
void VcsCommandPrivate::setup()
|
||||
{
|
||||
VcsOutputWindow::setRepository(m_defaultWorkingDirectory);
|
||||
if (m_flags & RunFlags::ExpectRepoChanges)
|
||||
GlobalFileChangeBlocker::instance()->forceBlocked(true);
|
||||
}
|
||||
|
||||
void VcsCommandPrivate::cleanup()
|
||||
{
|
||||
VcsOutputWindow::clearRepository();
|
||||
if (m_flags & RunFlags::ExpectRepoChanges)
|
||||
GlobalFileChangeBlocker::instance()->forceBlocked(false);
|
||||
}
|
||||
@@ -227,7 +229,6 @@ void VcsCommandPrivate::processDone()
|
||||
VcsCommand::VcsCommand(const FilePath &workingDirectory, const Environment &environment) :
|
||||
d(new Internal::VcsCommandPrivate(this, workingDirectory, environment))
|
||||
{
|
||||
VcsOutputWindow::setRepository(d->m_defaultWorkingDirectory);
|
||||
connect(ICore::instance(), &ICore::coreAboutToClose, this, [this] {
|
||||
if (d->m_process && d->m_process->isRunning())
|
||||
d->cleanup();
|
||||
|
||||
Reference in New Issue
Block a user