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 <sokcevic@chromium.org>
Auto-Submit: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
diff --git a/git_cl.py b/git_cl.py
index 7341b73..cc133c4 100755
--- a/git_cl.py
+++ b/git_cl.py
@@ -2489,9 +2489,9 @@
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 @@
'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)