tools/cl: don't try to prune branches with no upstream

This cleans up the output a bit when there are many local branches that
don't have an upstream configured.

BUG=None
TEST=tools/cl prune

Change-Id: Ic5892dcbca315613682326c5615fce28d49b421d
Reviewed-on: https://chromium-review.googlesource.com/c/crosvm/crosvm/+/3764046
Reviewed-by: Dennis Kempin <denniskempin@google.com>
Tested-by: Daniel Verkamp <dverkamp@chromium.org>
Commit-Queue: Dennis Kempin <denniskempin@google.com>
Auto-Submit: Daniel Verkamp <dverkamp@chromium.org>
This commit is contained in:
Daniel Verkamp 2022-07-15 15:31:43 -07:00 committed by crosvm LUCI
parent d12728e6d3
commit 57470a47d0

View file

@ -151,6 +151,7 @@ def prune(force: bool = False):
branch
for branch in list_local_branches()
if branch != current_branch
and get_upstream(branch) is not None
and all(
change.status in ["ABANDONED", "MERGED"] for change in LocalChange.list_changes(branch)
)