Parcourir la source

[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>
Arthur Milchior il y a 2 ans
Parent
commit
7f9b0231c4
1 fichiers modifiés avec 1 ajouts et 2 suppressions
  1. 1 2
      git_cl.py

+ 1 - 2
git_cl.py

@@ -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