summaryrefslogtreecommitdiffstats
path: root/git_config.py
diff options
context:
space:
mode:
authorNasser Grainawi <nasser@codeaurora.org>2014-09-19 12:13:04 -0600
committerKevin Degi <kdegi@codeaurora.org>2014-10-09 13:41:51 -0600
commit909d58b2e2e3695ecfa80a54b8700fb889a02677 (patch)
tree92056c473d30ec2e96a254a601b2dd37611dc364 /git_config.py
parent5cf16607d33268ab0320a886c4a7b5e052684fa4 (diff)
downloadgit-repo-909d58b2e2e3695ecfa80a54b8700fb889a02677.tar.gz
Support specifying non-HEADS refs as upstream
While not typical, some users might have an upstream that isn't in the usual refs/heads/* namespace. There's no reason not to use those refs as the value for the upstream attribute, so support doing so. Change-Id: I5b119f1135c3268c20e7c4084682e860d3ee1fb1
Diffstat (limited to 'git_config.py')
-rw-r--r--git_config.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/git_config.py b/git_config.py
index aa07d1b7..b4145e8c 100644
--- a/git_config.py
+++ b/git_config.py
@@ -619,8 +619,6 @@ class Remote(object):
619 """ 619 """
620 if IsId(rev): 620 if IsId(rev):
621 return rev 621 return rev
622 if rev.startswith(R_TAGS):
623 return rev
624 622
625 if not rev.startswith('refs/'): 623 if not rev.startswith('refs/'):
626 rev = R_HEADS + rev 624 rev = R_HEADS + rev
@@ -628,6 +626,10 @@ class Remote(object):
628 for spec in self.fetch: 626 for spec in self.fetch:
629 if spec.SourceMatches(rev): 627 if spec.SourceMatches(rev):
630 return spec.MapSource(rev) 628 return spec.MapSource(rev)
629
630 if not rev.startswith(R_HEADS):
631 return rev
632
631 raise GitError('remote %s does not have %s' % (self.name, rev)) 633 raise GitError('remote %s does not have %s' % (self.name, rev))
632 634
633 def WritesTo(self, ref): 635 def WritesTo(self, ref):