diff options
| author | Petar Perisin <petar.perisin@gmail.com> | 2013-04-08 13:02:25 +0300 |
|---|---|---|
| committer | Petar Perisin <petar.perisin@gmail.com> | 2013-04-08 19:23:47 +0200 |
| commit | c49fe8350d38e66067b62c10e7626d05919fdba2 (patch) | |
| tree | e2f22a41344fb0a9d2fc5ae9602e94b77d0c4d50 /src/plugins/git/gitplugin.cpp | |
| parent | 30f241892694191cbf563d640277df590d64ff37 (diff) | |
| download | qt-creator-c49fe8350d38e66067b62c10e7626d05919fdba2.tar.gz | |
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>
Diffstat (limited to 'src/plugins/git/gitplugin.cpp')
| -rw-r--r-- | src/plugins/git/gitplugin.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/src/plugins/git/gitplugin.cpp b/src/plugins/git/gitplugin.cpp index 22498c69d0..5796743901 100644 --- a/src/plugins/git/gitplugin.cpp +++ b/src/plugins/git/gitplugin.cpp @@ -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")); } } |
