summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorConley Owens <cco3@android.com>2014-10-01 17:22:46 -0700
committerConley Owens <cco3@android.com>2015-04-01 17:43:36 +0000
commit04f2f0e1860d10a4cc2a7b8ef7cc1665f51094b9 (patch)
treef1df7b5d37b98c01d5b8eb49051564fea547dfa6 /project.py
parentcb07ba7e3d466a98d0af0771b4f3e21116d69898 (diff)
downloadgit-repo-04f2f0e1860d10a4cc2a7b8ef7cc1665f51094b9.tar.gz
Maintain fully qualified tracking branches
When running repo branch, the git merge line (in many circumstances) is set to the revision of the project specified in the manifest. If this is a branch name that is not fully-qualified, we will end up with something like "merge = master" instead of "merge = refs/heads/master". This change examines the revision if we are going to use that and changes branch short names to fully qualified branch names. Change-Id: Ie1be94fb8d45df8eeac44a47f729a3819a05fa81
Diffstat (limited to 'project.py')
-rw-r--r--project.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/project.py b/project.py
index d11a3c94..e76d6394 100644
--- a/project.py
+++ b/project.py
@@ -1326,6 +1326,8 @@ class Project(object):
1326 if not ID_RE.match(self.revisionExpr): 1326 if not ID_RE.match(self.revisionExpr):
1327 # in case of manifest sync the revisionExpr might be a SHA1 1327 # in case of manifest sync the revisionExpr might be a SHA1
1328 branch.merge = self.revisionExpr 1328 branch.merge = self.revisionExpr
1329 if not branch.merge.startswith('refs/'):
1330 branch.merge = R_HEADS + branch.merge
1329 branch.Save() 1331 branch.Save()
1330 1332
1331 if cnt_mine > 0 and self.rebase: 1333 if cnt_mine > 0 and self.rebase:
@@ -1394,6 +1396,8 @@ class Project(object):
1394 branch = self.GetBranch(name) 1396 branch = self.GetBranch(name)
1395 branch.remote = self.GetRemote(self.remote.name) 1397 branch.remote = self.GetRemote(self.remote.name)
1396 branch.merge = self.revisionExpr 1398 branch.merge = self.revisionExpr
1399 if not branch.merge.startswith('refs/'):
1400 branch.merge = R_HEADS + self.revisionExpr
1397 revid = self.GetRevisionId(all_refs) 1401 revid = self.GetRevisionId(all_refs)
1398 1402
1399 if head.startswith(R_HEADS): 1403 if head.startswith(R_HEADS):