Git: Correctly handle aborting pull commands

For example, aborting a "git pull --rebase" command
did not work, because the old code tried to run
"git pull --abort" instead of "git rebase --abort".

As side effect, this patch also enables the Skip commit
button in handleMergeConflicts(), that was not shown
before.

Change-Id: Ifa43a4ba0199c97fdf8a361eb9e0207704d93e26
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Andre Hartmann
2019-07-02 08:11:13 +02:00
committed by André Hartmann
parent 9aef0c2ad3
commit b950936d45
2 changed files with 7 additions and 4 deletions

View File

@@ -2890,7 +2890,7 @@ void GitClient::pull(const QString &workingDirectory, bool rebase)
abortCommand = "merge";
}
VcsCommand *command = vcsExecAbortable(workingDirectory, arguments, rebase);
VcsCommand *command = vcsExecAbortable(workingDirectory, arguments, rebase, abortCommand);
connect(command, &VcsCommand::success, this,
[this, workingDirectory] { updateSubmodulesIfNeeded(workingDirectory, true); },
Qt::QueuedConnection);
@@ -3092,11 +3092,13 @@ void GitClient::revert(const QString &workingDirectory, const QString &argument)
// Stashing is handled prior to this call.
VcsCommand *GitClient::vcsExecAbortable(const QString &workingDirectory,
const QStringList &arguments,
bool isRebase)
bool isRebase,
QString abortCommand)
{
QTC_ASSERT(!arguments.isEmpty(), return nullptr);
QString abortCommand = arguments.at(0);
if (abortCommand.isEmpty())
abortCommand = arguments.at(0);
VcsCommand *command = createCommand(workingDirectory, nullptr, VcsWindowOutputBind);
command->setCookie(workingDirectory);
command->addFlags(VcsCommand::SshPasswordPrompt