From 94ba8a26d8d35af76c36da717ff6bd88350ae677 Mon Sep 17 00:00:00 2001 From: Josip Sokcevic Date: Tue, 2 Mar 2021 23:56:34 +0000 Subject: [PATCH] Update origin HEAD when running git migration This updates local reference to origin/HEAD, which is necessary for new-branch to work as expected. R=ehmaldonado@google.com Change-Id: Ia620b3b01c0ad23bb4e969f9026fa6bcfdd88b90 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2730051 Commit-Queue: Josip Sokcevic Auto-Submit: Josip Sokcevic Reviewed-by: Edward Lesmes --- git_migrate_default_branch.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/git_migrate_default_branch.py b/git_migrate_default_branch.py index a605059ba..71be6966b 100644 --- a/git_migrate_default_branch.py +++ b/git_migrate_default_branch.py @@ -54,7 +54,10 @@ def main(): if project_head != 'refs/heads/main': raise RuntimeError("The repository is not migrated yet.") + logging.info("Running fetch...") git_common.run('fetch', remote) + logging.info("Updating remote HEAD...") + git_common.run('remote', 'set-head', '-a', remote) branches = git_common.get_branches_info(True)