Commit 8e404a7e authored by Allen Bauer's avatar Allen Bauer Committed by LUCI CQ

Added option to keep empty branches in rebase-update.

Change-Id: I87b1edf242aa5c8483d8d84d223fc9187a194708
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2292962Reviewed-by: 's avatarDirk Pranke <dpranke@google.com>
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
parent 9af33fa2
......@@ -232,6 +232,8 @@ def main(args=None):
parser.add_argument('branches', nargs='*',
help='Branches to be rebased. All branches are assumed '
'if none specified.')
parser.add_argument('--keep-empty', '-e', action='store_true',
help='Do not automatically delete empty branches.')
opts = parser.parse_args(args)
if opts.verbose: # pragma: no cover
......@@ -314,7 +316,8 @@ def main(args=None):
print(' %s' % branch)
if not retcode:
remove_empty_branches(branch_tree)
if not opts.keep_empty:
remove_empty_branches(branch_tree)
# return_branch may not be there any more.
if return_branch in git.branches():
......
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