diff options
author | Orgad Shaneh <orgad.shaneh@audiocodes.com> | 2013-01-24 11:32:45 +0200 |
---|---|---|
committer | Orgad Shaneh <orgads@gmail.com> | 2013-01-24 13:25:06 +0100 |
commit | cf5f109b6841231232a3fe58308d893910d3a209 (patch) | |
tree | 20a60f9d6c2d9aaf9898bf3c2569437de8de4370 | |
parent | a85c32cb4aea1357abc44e0aa41bc573135b9d69 (diff) | |
download | qt-creator-cf5f109b6841231232a3fe58308d893910d3a209.tar.gz |
Git: Remove "Branch" from synchronousCheckoutBranch
Other refs can also be checked out using this function
Change-Id: I80a1c15244b1043cfce650a121c71174b9d322cb
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
-rw-r--r-- | src/plugins/git/branchmodel.cpp | 2 | ||||
-rw-r--r-- | src/plugins/git/gitclient.cpp | 8 | ||||
-rw-r--r-- | src/plugins/git/gitclient.h | 2 | ||||
-rw-r--r-- | src/plugins/git/gitversioncontrol.cpp | 4 |
4 files changed, 8 insertions, 8 deletions
diff --git a/src/plugins/git/branchmodel.cpp b/src/plugins/git/branchmodel.cpp index 17b2376a67..f4232fcbb6 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 e66c17bb93..5281cb277a 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 1063bac098..a6564bc967 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 752c607ba7..9ffaa79570 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. |