mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
[git-reparent-branch] Keep empty branches when doing rebase-update.
This fixes a bit of awkward UX where you create a new branch and immediately want to reparent it. Previously: ``` $ git new-branch something $ # Oops, I really wanted that to be based on other_branch $ git reparent-branch other_branch Reparenting something to track remove_urllib3_hack (was origin/main) Rebasing: something Deleted branch something (was e10e74d5). 'something' was merged with its parent, checking out 'origin/main' instead. ``` R=gavinmak@google.com Change-Id: I60cd4da4798094476d47ff684f301bbdee1293b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/4680281 Commit-Queue: Gavin Mak <gavinmak@google.com> Reviewed-by: Gavin Mak <gavinmak@google.com> Auto-Submit: Robbie Iannucci <iannucci@chromium.org>
This commit is contained in:
@@ -92,7 +92,7 @@ def main(args):
|
||||
for branch, parent in topo_iter(branch_tree):
|
||||
if parent in branches:
|
||||
branches.append(branch)
|
||||
return git_rebase_update.main(['--no-fetch'] + branches)
|
||||
return git_rebase_update.main(['--no-fetch', '--keep-empty'] + branches)
|
||||
|
||||
|
||||
if __name__ == '__main__': # pragma: no cover
|
||||
|
||||
Reference in New Issue
Block a user