diff --git a/src/plugins/git/branchmodel.cpp b/src/plugins/git/branchmodel.cpp index 17b2376a679..f4232fcbb69 100644 --- a/src/plugins/git/branchmodel.cpp +++ b/src/plugins/git/branchmodel.cpp @@ -448,7 +448,7 @@ void BranchModel::checkoutBranch(const QModelIndex &idx) return; stashGuard.preventPop(); QString errorMessage; - if (m_client->synchronousCheckoutBranch(m_workingDirectory, branch, &errorMessage)) { + if (m_client->synchronousCheckout(m_workingDirectory, branch, &errorMessage)) { if (errorMessage.isEmpty()) { QModelIndex currentIdx = currentBranch(); if (currentIdx.isValid()) { diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index e66c17bb93f..5281cb277a6 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -778,21 +778,21 @@ void GitClient::blame(const QString &workingDirectory, executeGit(workingDirectory, arguments, editor, false, VcsBase::Command::NoReport, lineNumber); } -bool GitClient::synchronousCheckoutBranch(const QString &workingDirectory, - const QString &branch, +bool GitClient::synchronousCheckout(const QString &workingDirectory, + const QString &ref, QString *errorMessage /* = 0 */) { QByteArray outputText; QByteArray errorText; QStringList arguments; - arguments << QLatin1String("checkout") << branch; + arguments << QLatin1String("checkout") << ref; const bool rc = fullySynchronousGit(workingDirectory, arguments, &outputText, &errorText); const QString output = commandOutputFromLocal8Bit(outputText); outputWindow()->append(output); if (!rc) { const QString stdErr = commandOutputFromLocal8Bit(errorText); //: Meaning of the arguments: %1: Branch, %2: Repository, %3: Error message - const QString msg = tr("Cannot checkout \"%1\" of \"%2\": %3").arg(branch, workingDirectory, stdErr); + const QString msg = tr("Cannot checkout \"%1\" of \"%2\": %3").arg(ref, workingDirectory, stdErr); if (errorMessage) *errorMessage = msg; else diff --git a/src/plugins/git/gitclient.h b/src/plugins/git/gitclient.h index 1063bac098f..a6564bc967e 100644 --- a/src/plugins/git/gitclient.h +++ b/src/plugins/git/gitclient.h @@ -156,7 +156,7 @@ public: QString revision = QString(), QString *errorMessage = 0, bool revertStaging = true); // Checkout branch - bool synchronousCheckoutBranch(const QString &workingDirectory, const QString &branch, QString *errorMessage = 0); + bool synchronousCheckout(const QString &workingDirectory, const QString &ref, QString *errorMessage = 0); // Do a stash and return identier. enum { StashPromptDescription = 0x1, StashImmediateRestore = 0x2, StashIgnoreUnchanged = 0x4 }; diff --git a/src/plugins/git/gitversioncontrol.cpp b/src/plugins/git/gitversioncontrol.cpp index 752c607ba77..9ffaa795704 100644 --- a/src/plugins/git/gitversioncontrol.cpp +++ b/src/plugins/git/gitversioncontrol.cpp @@ -208,10 +208,10 @@ bool GitVersionControl::vcsRestoreSnapshot(const QString &topLevel, const QStrin const QString revision = tokens.at(2); success = m_client->synchronousReset(topLevel); if (success && !branch.isEmpty()) { - success = m_client->synchronousCheckoutBranch(topLevel, branch) && + success = m_client->synchronousCheckout(topLevel, branch) && m_client->synchronousCheckoutFiles(topLevel, QStringList(), revision); } else { - success = m_client->synchronousCheckoutBranch(topLevel, revision); + success = m_client->synchronousCheckout(topLevel, revision); } } else { // Restore stash if it can be resolved.