[depot_tools] Use a function instead of reimplementing it.

It seems dubious that this function ever need to change. But it’s
safer to use this function just in case.

Bug: 1428476
Change-Id: I3c60e6be5c7dab6f003c209b47340e7573819e16
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4403090
Commit-Queue: Arthur Milchior <arthurmilchior@chromium.org>
Reviewed-by: Gavin Mak <gavinmak@google.com>
changes/90/4403090/3
Arthur Milchior 2 years ago committed by LUCI CQ
parent 61ebd177ab
commit 7f9b0231c4

@ -4262,8 +4262,7 @@ def SwitchToIssue(options, args):
# Print the various branches
PrintIssueToBranches(options, args)
DieWithError('Multiple branches associated to issue: %d' % issue_num)
prefix_size = len('refs/heads/')
RunGit(['switch', branches[0][prefix_size:]])
RunGit(['switch', scm.GIT.ShortBranchName(branches[0])])
return 0

Loading…
Cancel
Save