Don't enforce branch limit on rebase-update if only rebasing current

Bug: 1421399
Change-Id: I29ebcef2a88256aac6153556af75158679f44296
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4311855
Reviewed-by: Joanna Wang <jojwang@chromium.org>
Commit-Queue: Gavin Mak <gavinmak@google.com>
diff --git a/git_rebase_update.py b/git_rebase_update.py
index c4dbd2f..e557ab1 100755
--- a/git_rebase_update.py
+++ b/git_rebase_update.py
@@ -268,7 +268,7 @@
   if opts.current:
     branches_to_rebase.add(git.current_branch())
 
-  skipped, branch_tree = git.get_branch_tree()
+  skipped, branch_tree = git.get_branch_tree(use_limit=not opts.current)
   if branches_to_rebase:
     skipped = set(skipped).intersection(branches_to_rebase)
   for branch in skipped:
@@ -321,7 +321,7 @@
       remove_empty_branches(branch_tree)
 
     # return_branch may not be there any more.
-    if return_branch in git.branches():
+    if return_branch in git.branches(use_limit=False):
       git.run('checkout', return_branch)
       git.thaw()
     else: