Commit 0e867850 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Git: Preserve multiple branches that link to the same commit

If remote HEAD commit is referenced by multiple branches, only the last
one is currently listed

Change-Id: Iac689125610aaf49c0bc31285a0d283fd48a271c
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent 5c653f40
......@@ -1673,10 +1673,12 @@ QStringList GitClient::synchronousRepositoryBranches(const QString &repositoryUR
const QString pattern = QLatin1String("\trefs/heads/");
const int pos = line.lastIndexOf(pattern);
bool headFound = false;
if (pos != -1) {
const QString branchName = line.mid(pos + pattern.count());
if (line.startsWith(headSha)) {
if (!headFound && line.startsWith(headSha)) {
branches[0] = branchName;
headFound = true;
if (isDetached)
*isDetached = false;
} else {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment