Commit 8031f2ad authored by Josip Sokcevic's avatar Josip Sokcevic Committed by LUCI CQ

Update HEAD when checking out from git cache

HEAD may be different than what git cache has. This change ensures the
correct revision is used.

R=gavinmak@google.com

Bug: 1251783
Change-Id: I4909a4d52ef70ee806c285f24693eca5173003d9
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/3174363
Auto-Submit: Josip Sokcevic <sokcevic@google.com>
Commit-Queue: Gavin Mak <gavinmak@google.com>
Reviewed-by: 's avatarGavin Mak <gavinmak@google.com>
parent ffbe9699
......@@ -727,6 +727,11 @@ def _git_checkout(sln, sln_dir, revisions, refs, no_fetch_tags, git_cache_dir,
git('remote', 'set-url', 'origin', mirror_dir, cwd=sln_dir)
git('fetch', 'origin', cwd=sln_dir)
git('remote', 'set-url', '--push', 'origin', url, cwd=sln_dir)
if revision == 'HEAD':
# Update HEAD since cache may point to a different rev
git('remote', 'set-head', 'origin', '-a', cwd=sln_dir)
if pin:
git('fetch', 'origin', pin, cwd=sln_dir)
for ref in refs:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment