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);
|
synchronousAbortCommand(workingDirectory, gitCommand);
|
||||||
break;
|
break;
|
||||||
default: // Continue/Skip
|
default: // Continue/Skip
|
||||||
if (isRebase)
|
if (isRebase) {
|
||||||
synchronousCommandContinue(workingDirectory, gitCommand, hasChanges);
|
// Git might request an editor, so this must be done asynchronously
|
||||||
else
|
// 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();
|
GitPlugin::instance()->startCommit();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2218,13 +2231,6 @@ bool GitClient::synchronousPull(const QString &workingDirectory, bool rebase)
|
|||||||
return executeAndHandleConflicts(workingDirectory, arguments, abortCommand);
|
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)
|
void GitClient::synchronousAbortCommand(const QString &workingDir, const QString &abortCommand)
|
||||||
{
|
{
|
||||||
// Abort to clean if something goes wrong
|
// Abort to clean if something goes wrong
|
||||||
|
|||||||
@@ -197,7 +197,6 @@ public:
|
|||||||
QString vcsGetRepositoryURL(const QString &directory);
|
QString vcsGetRepositoryURL(const QString &directory);
|
||||||
bool synchronousFetch(const QString &workingDirectory, const QString &remote);
|
bool synchronousFetch(const QString &workingDirectory, const QString &remote);
|
||||||
bool synchronousPull(const QString &workingDirectory, bool rebase);
|
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 synchronousPush(const QString &workingDirectory, const QString &remote = QString());
|
||||||
bool synchronousMerge(const QString &workingDirectory, const QString &branch);
|
bool synchronousMerge(const QString &workingDirectory, const QString &branch);
|
||||||
bool synchronousRebase(const QString &workingDirectory,
|
bool synchronousRebase(const QString &workingDirectory,
|
||||||
|
|||||||
Reference in New Issue
Block a user