From dbbe224787188ca748eef54e44d6651c1c90b90b Mon Sep 17 00:00:00 2001 From: Nikita Leshenko Date: Mon, 22 Jan 2024 21:08:57 +0000 Subject: [PATCH] gclient: Call _AutoFetchRef before using a rev in _FetchAndReset Other places in gclient_scm (GitWrapper._Clone, GitWrapper.update) do the same. Note that we call _AutoFetchRef even after running _Fetch, because _Fetch in not guaranteed to fetch a specific revision. For example, a checkout might be configured without branch heads and without tags, yet a revision might point to a tag. Change-Id: I5cfd8ebafa4b45afd72b0251f04e5d713199f2fd Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4715239 Commit-Queue: Yiwei Zhang Reviewed-by: Yiwei Zhang --- gclient_scm.py | 1 + 1 file changed, 1 insertion(+) diff --git a/gclient_scm.py b/gclient_scm.py index 6ade70bd7..e6a11de98 100644 --- a/gclient_scm.py +++ b/gclient_scm.py @@ -307,6 +307,7 @@ class GitWrapper(SCMWrapper): self._SetFetchConfig(options) self._Fetch(options, prune=True, quiet=options.verbose) + revision = self._AutoFetchRef(options, revision) self._Scrub(revision, options) if file_list is not None: files = self._Capture(['-c', 'core.quotePath=false',