mirror of
https://gerrit.googlesource.com/git-repo
synced 2024-12-21 07:16:21 +00:00
Force a fetch when superproject has a newer SHA1 for remote branch.
For older git-repo versions, we might have only fetched the SHA1 revision that was provided by the project, but have remote branch left intact as long as they exist. When the remote branch become stale, some repo operations like rebase would fail, and repo sync would not correct this situation. Fix this by tightening the requirement to also require the superproject provided SHA1 be an ancestor or equal to the tip-of-tree of the remote branch. Bug: [google internal] b/193798453 Change-Id: Ie34c5d860dabb1cbd9f822da929088ec69c79cf6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312642 Tested-by: Xin Li <delphij@google.com> Reviewed-by: Raman Tenneti <rtenneti@google.com>
This commit is contained in:
parent
c34b91c9d8
commit
8e983bbc0f
@ -1971,6 +1971,7 @@ class Project(object):
|
||||
rev = self.GetRemote(self.remote.name).ToLocal(self.upstream)
|
||||
self.bare_git.rev_list('-1', '--missing=allow-any',
|
||||
'%s^0' % rev, '--')
|
||||
self.bare_git.merge_base('--is-ancestor', self.revisionExpr, rev)
|
||||
return True
|
||||
except GitError:
|
||||
# There is no such persistent revision. We have to fetch it.
|
||||
|
Loading…
Reference in New Issue
Block a user