summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorXin Li <delphij@google.com>2021-07-20 20:15:30 +0000
committerXin Li <delphij@google.com>2021-07-20 23:26:01 +0000
commit8e983bbc0f5f48aa38d0e1c5a37766ce121d28eb (patch)
tree36a0f156613796dc4a24ea84d0f31833f0368d62 /project.py
parentc34b91c9d80d6d6510c500cb8a8a9ee448963f09 (diff)
downloadgit-repo-8e983bbc0f5f48aa38d0e1c5a37766ce121d28eb.tar.gz
Force a fetch when superproject has a newer SHA1 for remote branch.v2.16.3
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>
Diffstat (limited to 'project.py')
-rw-r--r--project.py1
1 files changed, 1 insertions, 0 deletions
diff --git a/project.py b/project.py
index e777dbd2..a55e7600 100644
--- a/project.py
+++ b/project.py
@@ -1971,6 +1971,7 @@ class Project(object):
1971 rev = self.GetRemote(self.remote.name).ToLocal(self.upstream) 1971 rev = self.GetRemote(self.remote.name).ToLocal(self.upstream)
1972 self.bare_git.rev_list('-1', '--missing=allow-any', 1972 self.bare_git.rev_list('-1', '--missing=allow-any',
1973 '%s^0' % rev, '--') 1973 '%s^0' % rev, '--')
1974 self.bare_git.merge_base('--is-ancestor', self.revisionExpr, rev)
1974 return True 1975 return True
1975 except GitError: 1976 except GitError:
1976 # There is no such persistent revision. We have to fetch it. 1977 # There is no such persistent revision. We have to fetch it.