mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-23 07:16:21 +00:00
Always output upstream if specified
Previously, in running the `manifest` command, we wouldn't output the upstream if the default upstream would include the pinned sha1. However, now that fetching refs/heads/* doesn't guarantee that we will have the sha1, we need to always output the specified upstream branch. Change-Id: Ib8b409a8ecd439397b38ee9649c530407797f841
This commit is contained in:
parent
c5ceeb1625
commit
551dfecea9
@ -253,10 +253,12 @@ class XmlManifest(object):
|
|||||||
else:
|
else:
|
||||||
value = p.work_git.rev_parse(HEAD + '^0')
|
value = p.work_git.rev_parse(HEAD + '^0')
|
||||||
e.setAttribute('revision', value)
|
e.setAttribute('revision', value)
|
||||||
if peg_rev_upstream and value != p.revisionExpr:
|
if peg_rev_upstream:
|
||||||
|
if p.upstream:
|
||||||
|
e.setAttribute('upstream', p.upstream)
|
||||||
|
elif value != p.revisionExpr:
|
||||||
# Only save the origin if the origin is not a sha1, and the default
|
# Only save the origin if the origin is not a sha1, and the default
|
||||||
# isn't our value, and the if the default doesn't already have that
|
# isn't our value
|
||||||
# covered.
|
|
||||||
e.setAttribute('upstream', p.revisionExpr)
|
e.setAttribute('upstream', p.revisionExpr)
|
||||||
else:
|
else:
|
||||||
revision = self.remotes[remoteName].revision or d.revisionExpr
|
revision = self.remotes[remoteName].revision or d.revisionExpr
|
||||||
|
Loading…
Reference in New Issue
Block a user