mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
sync: Fix a corner case when both superproject and depth used.
When depth is used, we would fetch only SHA1 when superproject is used, as the result, only the manifest branch is being recorded, and commands like repo start would fail. Fix this by saving the upstream branch value in the overlay manifest and add the upstream branch to fetch list. Bug: [google internal] b/185951360 Change-Id: Ib36f56067723f2572ed817785b31cc928ddfec0a Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/304562 Reviewed-by: Raman Tenneti <rtenneti@google.com> Reviewed-by: Jonathan Nieder <jrn@google.com> Tested-by: Xin Li <delphij@google.com>
This commit is contained in:
parent
a1cd770d56
commit
aabf79d3f0
@ -1214,6 +1214,9 @@ class Project(object):
|
|||||||
(self.revisionExpr, self.name))
|
(self.revisionExpr, self.name))
|
||||||
|
|
||||||
def SetRevisionId(self, revisionId):
|
def SetRevisionId(self, revisionId):
|
||||||
|
if self.clone_depth or self.manifest.manifestProject.config.GetString('repo.depth'):
|
||||||
|
self.upstream = self.revisionExpr
|
||||||
|
|
||||||
self.revisionId = revisionId
|
self.revisionId = revisionId
|
||||||
|
|
||||||
def Sync_LocalHalf(self, syncbuf, force_sync=False, submodules=False):
|
def Sync_LocalHalf(self, syncbuf, force_sync=False, submodules=False):
|
||||||
@ -2134,6 +2137,8 @@ class Project(object):
|
|||||||
# Shallow checkout of a specific commit, fetch from that commit and not
|
# Shallow checkout of a specific commit, fetch from that commit and not
|
||||||
# the heads only as the commit might be deeper in the history.
|
# the heads only as the commit might be deeper in the history.
|
||||||
spec.append(branch)
|
spec.append(branch)
|
||||||
|
if self.upstream:
|
||||||
|
spec.append(self.upstream)
|
||||||
else:
|
else:
|
||||||
if is_sha1:
|
if is_sha1:
|
||||||
branch = self.upstream
|
branch = self.upstream
|
||||||
|
Loading…
Reference in New Issue
Block a user