Added option to keep empty branches in rebase-update.

Change-Id: I87b1edf242aa5c8483d8d84d223fc9187a194708
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/2292962
Reviewed-by: Dirk Pranke <dpranke@google.com>
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
changes/62/2292962/2
Allen Bauer 5 years ago committed by LUCI CQ
parent 9af33fa208
commit 8e404a7e49

@ -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():

Loading…
Cancel
Save