Don't append branch to fetch spec when syncing to a mirror

Appending the branch to the fetch spec causes sync of a mirror to
fail for projects that don't have an explicit revision specified,
and don't have a branch of the same name as the default revision.

For example, a manifest defining a default revision:

 <default revision="master">

having a project without an explicit revision:

 <project name="path/to/project">

and not having a branch named "master", will cause repo sync to
fail for that project with the error:

 Couldn't find remote ref refs/heads/master

Modify the logic to not append the branch onto the fetch spec when
syncing to a mirror.

Change-Id: I5c4457bd125519abf27abe682dea62ad708978c9
This commit is contained in:
David Pursehouse 2015-04-27 10:41:33 +09:00
parent a38769cda8
commit 403b64edf4

View File

@ -1853,6 +1853,7 @@ class Project(object):
spec.append('tag')
spec.append(tag_name)
if not self.manifest.IsMirror:
branch = self.revisionExpr
if is_sha1 and depth:
# Shallow checkout of a specific commit, fetch from that commit and not