mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 10:41:31 +00:00
Fetch remote when applying patches in gclient
Remote references may not be up-to-date, resulting in cherry-picking way more changes than needed. In such scenario, it is possible that some cherry-picking results in conflict and therefore fails gclient sync. R=gavinmak@google.com Bug: 1255178 Change-Id: Ibc67ae06c5798286b7510e4119d882053dc9b73f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3206616 Reviewed-by: Gavin Mak <gavinmak@google.com> Commit-Queue: Josip Sokcevic <sokcevic@google.com>
This commit is contained in:
@@ -396,6 +396,9 @@ class GitWrapper(SCMWrapper):
|
||||
self.Print('Trying the corresponding remote ref for %r: %r\n' % (
|
||||
target_rev, remote_ref))
|
||||
if scm.GIT.IsValidRevision(self.checkout_path, remote_ref):
|
||||
# refs/remotes may need to be updated to cleanly cherry-pick changes.
|
||||
# See https://crbug.com/1255178.
|
||||
self._Capture(['fetch', '--no-tags', self.remote, target_rev])
|
||||
target_rev = remote_ref
|
||||
elif not scm.GIT.IsValidRevision(self.checkout_path, target_rev):
|
||||
# Fetch |target_rev| if it's not already available.
|
||||
|
||||
Reference in New Issue
Block a user