New issue
Advanced search Search tips

Issue 839406 link

Starred by 2 users

Issue metadata

Status: Started
Owner:
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug



Sign in to add a comment

git_rebase_update.py fails to delete current branch

Project Member Reported by cmumford@chromium.org, May 3 2018

Issue description

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.
 

Sign in to add a comment