From cb243d3ef07b080b6e51ff50725222e989b03789 Mon Sep 17 00:00:00 2001 From: Victor Ding Date: Mon, 22 Aug 2022 07:48:16 +0000 Subject: [PATCH] tools/cl: add 'fetch origin' before 'checkout -B' 'checkout -B' would fail if 'origin' isn't fetched or is too outdated. BUG=None TEST=tools/cl # on a repo where 'origin' isn't fetched Change-Id: I13a5d8a3796c4c9002243902a5f8d145dc9393ef Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3844820 Tested-by: Victor Ding Reviewed-by: Dennis Kempin Commit-Queue: Victor Ding Auto-Submit: Victor Ding --- tools/cl | 1 + 1 file changed, 1 insertion(+) diff --git a/tools/cl b/tools/cl index addbb6e25e..6ff02a1e67 100755 --- a/tools/cl +++ b/tools/cl @@ -188,6 +188,7 @@ def rebase(): rev = git("rev-parse", upstream_branch_name).stdout(check=False) if rev: print(f"Leaving behind previous revision of {upstream_branch_name}: {rev}") + git("fetch origin").fg() git("checkout -B", upstream_branch_name, "origin/main").fg(quiet=True) print(f"Cherry-picking changes from {branch_name}")