From 04f2f0e1860d10a4cc2a7b8ef7cc1665f51094b9 Mon Sep 17 00:00:00 2001 From: Conley Owens Date: Wed, 1 Oct 2014 17:22:46 -0700 Subject: [PATCH] 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 --- project.py | 4 ++++ 1 file changed, 4 insertions(+) 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): if not ID_RE.match(self.revisionExpr): # in case of manifest sync the revisionExpr might be a SHA1 branch.merge = self.revisionExpr + if not branch.merge.startswith('refs/'): + branch.merge = R_HEADS + branch.merge branch.Save() if cnt_mine > 0 and self.rebase: @@ -1394,6 +1396,8 @@ class Project(object): branch = self.GetBranch(name) branch.remote = self.GetRemote(self.remote.name) branch.merge = self.revisionExpr + if not branch.merge.startswith('refs/'): + branch.merge = R_HEADS + self.revisionExpr revid = self.GetRevisionId(all_refs) if head.startswith(R_HEADS):