Commit cc3f1ad0 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

Git: Run continue command asynchronously



Git might request an editor on continue

Change-Id: I374e9889e32ea1b1b5ed04f9be9d2a829f3b6440
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
Reviewed-by: default avatarPetar Perisin <petar.perisin@gmail.com>
parent a195ec52
......@@ -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
......
......@@ -197,7 +197,6 @@ public:
QString vcsGetRepositoryURL(const QString &directory);
bool synchronousFetch(const QString &workingDirectory, const QString &remote);
bool synchronousPull(const QString &workingDirectory, bool rebase);
bool synchronousCommandContinue(const QString &workingDirectory, const QString &command, bool hasChanges);
bool synchronousPush(const QString &workingDirectory, const QString &remote = QString());
bool synchronousMerge(const QString &workingDirectory, const QString &branch);
bool synchronousRebase(const QString &workingDirectory,
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment