mirror of
https://github.com/Dev-Wiki/git-repo.git
synced 2025-12-13 16:14:02 +08:00
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
This commit is contained in:
committed by
Kevin Degi
parent
5cf16607d3
commit
909d58b2e2
@@ -619,8 +619,6 @@ class Remote(object):
|
||||
"""
|
||||
if IsId(rev):
|
||||
return rev
|
||||
if rev.startswith(R_TAGS):
|
||||
return rev
|
||||
|
||||
if not rev.startswith('refs/'):
|
||||
rev = R_HEADS + rev
|
||||
@@ -628,6 +626,10 @@ class Remote(object):
|
||||
for spec in self.fetch:
|
||||
if spec.SourceMatches(rev):
|
||||
return spec.MapSource(rev)
|
||||
|
||||
if not rev.startswith(R_HEADS):
|
||||
return rev
|
||||
|
||||
raise GitError('remote %s does not have %s' % (self.name, rev))
|
||||
|
||||
def WritesTo(self, ref):
|
||||
|
||||
Reference in New Issue
Block a user