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_common.py b/git_common.py
index 86a571e..cd60bf6 100644
--- a/git_common.py
+++ b/git_common.py
@@ -502,7 +502,7 @@
   return ' '.join(ret) or None
 
 
-def get_branch_tree():
+def get_branch_tree(use_limit=False):
   """Get the dictionary of {branch: parent}, compatible with topo_iter.
 
   Returns a tuple of (skipped, <branch_tree dict>) where skipped is a set of
@@ -511,7 +511,7 @@
   skipped = set()
   branch_tree = {}
 
-  for branch in branches():
+  for branch in branches(use_limit=use_limit):
     parent = upstream(branch)
     if not parent:
       skipped.add(branch)