Git: Fix branch list when checking out from git

Task-number: QTCREATORBUG-6563

Change-Id: I18f20c477a5c3ac3921110c1f76f15fedeaab99b
Reviewed-by: Hugues Delorme <delorme.hugues@fougsys.fr>
This commit is contained in:
Tobias Hunger
2011-12-07 13:43:03 +01:00
committed by Hugues Delorme
parent fe70f2db3b
commit 854a37cb1e

View File

@@ -1476,9 +1476,10 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
continue; continue;
} }
const int slashPos = line.lastIndexOf(QLatin1Char('/')); const QString pattern = QLatin1String("\trefs/heads/");
const QString branchName = line.mid(slashPos + 1); const int pos = line.lastIndexOf(pattern);
if (slashPos != -1) { const QString branchName = line.mid(pos + pattern.count());
if (pos != -1) {
if (line.startsWith(headSha)) if (line.startsWith(headSha))
branches[0] = branchName; branches[0] = branchName;
else else