From 854a37cb1efc10d032a83e93187aad2608d16e58 Mon Sep 17 00:00:00 2001 From: Tobias Hunger Date: Wed, 7 Dec 2011 13:43:03 +0100 Subject: [PATCH] Git: Fix branch list when checking out from git Task-number: QTCREATORBUG-6563 Change-Id: I18f20c477a5c3ac3921110c1f76f15fedeaab99b Reviewed-by: Hugues Delorme --- src/plugins/git/gitclient.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp index eeb297a511f..40c5071fb2b 100644 --- a/src/plugins/git/gitclient.cpp +++ b/src/plugins/git/gitclient.cpp @@ -1476,9 +1476,10 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR continue; } - const int slashPos = line.lastIndexOf(QLatin1Char('/')); - const QString branchName = line.mid(slashPos + 1); - if (slashPos != -1) { + const QString pattern = QLatin1String("\trefs/heads/"); + const int pos = line.lastIndexOf(pattern); + const QString branchName = line.mid(pos + pattern.count()); + if (pos != -1) { if (line.startsWith(headSha)) branches[0] = branchName; else