forked from qt-creator/qt-creator
Git: Run continue command asynchronously
Git might request an editor on continue Change-Id: I374e9889e32ea1b1b5ed04f9be9d2a829f3b6440 Reviewed-by: Tobias Hunger <tobias.hunger@digia.com> Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
a195ec5298
commit
cc3f1ad07d
@@ -1732,10 +1732,23 @@ void GitClient::continuePreviousGitCommand(const QString &workingDirectory,
|
||||
synchronousAbortCommand(workingDirectory, gitCommand);
|
||||
break;
|
||||
default: // Continue/Skip
|
||||
if (isRebase)
|
||||
synchronousCommandContinue(workingDirectory, gitCommand, hasChanges);
|
||||
else
|
||||
if (isRebase) {
|
||||
// Git might request an editor, so this must be done asynchronously
|
||||
// and without timeout
|
||||
QStringList arguments;
|
||||
arguments << gitCommand << QLatin1String(hasChanges ? "--continue" : "--skip");
|
||||
outputWindow()->appendCommand(workingDirectory,
|
||||
settings()->stringValue(GitSettings::binaryPathKey),
|
||||
arguments);
|
||||
VcsBase::Command *command = createCommand(workingDirectory, 0, true);
|
||||
command->addJob(arguments, -1);
|
||||
command->execute();
|
||||
ConflictHandler *handler = new ConflictHandler(command, workingDirectory, gitCommand);
|
||||
connect(command, SIGNAL(outputData(QByteArray)), handler, SLOT(readStdOut(QByteArray)));
|
||||
connect(command, SIGNAL(errorText(QString)), handler, SLOT(readStdErr(QString)));
|
||||
} else {
|
||||
GitPlugin::instance()->startCommit();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2218,13 +2231,6 @@ bool GitClient::synchronousPull(const QString &workingDirectory, bool rebase)
|
||||
return executeAndHandleConflicts(workingDirectory, arguments, abortCommand);
|
||||
}
|
||||
|
||||
bool GitClient::synchronousCommandContinue(const QString &workingDirectory, const QString &command, bool hasChanges)
|
||||
{
|
||||
QStringList arguments;
|
||||
arguments << command << QLatin1String(hasChanges ? "--continue" : "--skip");
|
||||
return executeAndHandleConflicts(workingDirectory, arguments, command);
|
||||
}
|
||||
|
||||
void GitClient::synchronousAbortCommand(const QString &workingDir, const QString &abortCommand)
|
||||
{
|
||||
// Abort to clean if something goes wrong
|
||||
|
||||
Reference in New Issue
Block a user