Commit e0dff208 authored by Antonio Sartori's avatar Antonio Sartori Committed by LUCI CQ

Make git map-branches faster

This change makes git map-branches a little bit faster by avoiding
fetching the revision list of each branch if git map-branches will not
show the tracking info anyway.

Change-Id: I47458871f904004f910aadd7d774bea5193c979e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2695393Reviewed-by: 's avatarAnthony Polito <apolito@google.com>
Commit-Queue: Antonio Sartori <antoniosartori@chromium.org>
parent 5e37f6de
...@@ -1045,6 +1045,7 @@ def get_branches_info(include_tracking_status): ...@@ -1045,6 +1045,7 @@ def get_branches_info(include_tracking_status):
(branch, branch_hash, upstream_branch, tracking_status) = line.split(':') (branch, branch_hash, upstream_branch, tracking_status) = line.split(':')
commits = None commits = None
if include_tracking_status:
base = get_or_create_merge_base(branch) base = get_or_create_merge_base(branch)
if base: if base:
commits_list = run('rev-list', '--count', branch, '^%s' % base, '--') commits_list = run('rev-list', '--count', branch, '^%s' % base, '--')
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment