From ca3ebf119e8f74975f273278e93b70d7cf8ff480 Mon Sep 17 00:00:00 2001 From: Alexander Thomas Date: Wed, 16 Nov 2022 19:33:42 +0000 Subject: [PATCH] Revert "Reset origin/HEAD in git_cache if it points to master" This reverts commit 63fea808b00889ca603f083febe010a8fa7dded7. Reason for revert: broke bot_update for dart, b/259380822 Original change's description: > Reset origin/HEAD in git_cache if it points to master > > This change resets refs/remotes/origin/HEAD if it points to master. With the master to main migration going on with chromium repositories, some of the cached git repositories end up pointing to master instead of main. This change aids in fixing this issue. > > Bug: 1364030 > Change-Id: Ic181b0179daf7b2b842cff7f7187d94d9fb20007 > Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4029356 > Auto-Submit: Aravind Vasudevan > Reviewed-by: Josip Sokcevic > Commit-Queue: Josip Sokcevic Bug: 1364030 Change-Id: I96842c15eba886f5b95cdd10f323b907d5ea165d No-Presubmit: true No-Tree-Checks: true No-Try: true Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4030304 Reviewed-by: Gavin Mak Bot-Commit: Rubber Stamper Reviewed-by: William Hesse Commit-Queue: Alexander Thomas --- git_cache.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/git_cache.py b/git_cache.py index 0c80ccfa83..1c5a1fe38f 100755 --- a/git_cache.py +++ b/git_cache.py @@ -439,15 +439,6 @@ class Mirror(object): 'Git cache has a lot of pack files (%d). Tried to re-bootstrap ' 'but failed. Continuing with non-optimized repository.' % len(pack_files)) - else: - # Reset head when refs/remotes/origin/HEAD points to master. - # https://crbug.com/1364030 - origin_head = subprocess.check_output( - [self.git_exe, 'symbolic-ref', 'refs/remotes/origin/HEAD'], - cwd=self.mirror_path).decode('utf-8', 'ignore').strip() - - if origin_head.endswith('master'): - self.RunGit(['remote', 'set-head', '-a', 'origin']) def _fetch(self, rundir,