forked from qt-creator/qt-creator
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: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
committed by
Orgad Shaneh
parent
5c653f40a3
commit
0e86785019
@@ -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 {
|
||||
|
Reference in New Issue
Block a user