From c9cf90ae9959716e211a9f6d152848b63904d074 Mon Sep 17 00:00:00 2001 From: "bauerb@chromium.org" Date: Mon, 28 Apr 2014 20:32:31 +0000 Subject: [PATCH] Clear configured merge-base when switching upstream. Otherwise, the old merge-base value can confuse the hell out of `git cl upload`. BUG=none Review URL: https://codereview.chromium.org/252683003 git-svn-id: svn://svn.chromium.org/chrome/trunk/tools/depot_tools@266648 0039d316-1c4b-4281-b951-d872f2087c98 --- git_cl.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/git_cl.py b/git_cl.py index 1acc12a691..e8cadf270d 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2320,9 +2320,13 @@ def CMDupstream(parser, args): cl = Changelist() if args: # One arg means set upstream branch. - RunGit(['branch', '--set-upstream', cl.GetBranch(), args[0]]) + branch = cl.GetBranch() + RunGit(['branch', '--set-upstream', branch, args[0]]) cl = Changelist() print "Upstream branch set to " + cl.GetUpstreamBranch() + + # Clear configured merge-base, if there is one. + git_common.remove_merge_base(branch) else: print cl.GetUpstreamBranch() return 0