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 <yiwzhang@google.com>
Reviewed-by: Yiwei Zhang <yiwzhang@google.com>
changes/39/4715239/4
Nikita Leshenko 1 year ago committed by LUCI CQ
parent c341d58921
commit dbbe224787

@ -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',

Loading…
Cancel
Save