git rebase-update will fail to delete a branch when it is the current branch with the following uncaught exception.
git rebase-update will fail to delete a branch when it is the current branch with the following uncaught exception.
Traceback (most recent call last):
File "/home/dir/src/depot_tools/git_rebase_update.py", line 333, in <module>
sys.exit(main())
File "/home/dir/src/depot_tools/git_rebase_update.py", line 301, in main
remove_empty_branches(branch_tree)
File "/home/dir/src/depot_tools/git_rebase_update.py", line 136, in remove_empty_branches
print git.run('branch', '-d', branch)
File "/home/dir/src/depot_tools/git_common.py", line 688, in run
return run_with_stderr(*cmd, **kwargs)[0]
File "/home/dir/src/depot_tools/git_common.py", line 757, in run_with_stderr
raise subprocess2.CalledProcessError(retcode, cmd, os.getcwd(), ret, err)
subprocess2.CalledProcessError: Command 'git -c color.ui=never branch -d master' returned non-zero exit status 1 in /home/dir/src
error: Cannot delete branch 'master' checked out at '/home/dir/src'
If there are multiple branches that should be deleted then any branch after the failing one will not be deleted.
Comment 1 by cmumford@chromium.org
, May 22 2018