From c023a6302fc665bae743a5833dea350fd3d0749f Mon Sep 17 00:00:00 2001 From: Joanna Wang Date: Thu, 26 Jan 2023 17:59:25 +0000 Subject: [PATCH] Always set issue for branch, not just when newbranch is passed. Bug: 1410392 Change-Id: Ib9842a4924a6df486dc8b0ee37e673286139f62a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4196054 Reviewed-by: Josip Sokcevic Auto-Submit: Joanna Wang Commit-Queue: Josip Sokcevic --- git_cl.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/git_cl.py b/git_cl.py index 7341b736c..cc133c4cd 100755 --- a/git_cl.py +++ b/git_cl.py @@ -2489,9 +2489,9 @@ class Changelist(object): RunGit(['fetch', fetch_info['url'], fetch_info['ref']]) - # If we have created a new branch then do the "set issue" immediately in - # case the cherry-pick fails, which happens when resolving conflicts. - if newbranch: + # Set issue immediately in case the cherry-pick fails, which happens + # when resolving conflicts. + if self.GetBranch(): self.SetIssue(parsed_issue_arg.issue) if force: @@ -2511,7 +2511,6 @@ class Changelist(object): 'If you want to do that, use "git cl patch --force" instead.') if self.GetBranch(): - self.SetIssue(parsed_issue_arg.issue) self.SetPatchset(patchset) fetched_hash = scm.GIT.ResolveCommit(settings.GetRoot(), 'FETCH_HEAD') self._GitSetBranchConfigValue(LAST_UPLOAD_HASH_CONFIG_KEY, fetched_hash)