Git: Add a function for getting current local branch

Change-Id: Ibda70cb896633cc7afa3a845b99aac523246c558
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Petar Perisin
2013-04-08 13:02:25 +03:00
parent 30f2418926
commit c49fe8350d
4 changed files with 29 additions and 35 deletions

View File

@@ -1001,12 +1001,11 @@ void GitPlugin::pull()
bool rebase = m_gitClient->settings()->boolValue(GitSettings::pullRebaseKey);
if (!rebase) {
bool isDetached;
QString branchRebaseConfig = m_gitClient->synchronousRepositoryBranches(topLevel, &isDetached).at(0);
if (!isDetached) {
branchRebaseConfig.prepend(QLatin1String("branch."));
branchRebaseConfig.append(QLatin1String(".rebase"));
rebase = (m_gitClient->readConfigValue(topLevel, branchRebaseConfig) == QLatin1String("true"));
QString currentBranch = m_gitClient->synchronousCurrentLocalBranch(topLevel);
if (!currentBranch.isEmpty()) {
currentBranch.prepend(QLatin1String("branch."));
currentBranch.append(QLatin1String(".rebase"));
rebase = (m_gitClient->readConfigValue(topLevel, currentBranch) == QLatin1String("true"));
}
}