bug report: spurious "cannot delete branch '%s' used by worktree"
- From
- Tamir Duberstein <tamird@fuseenergy.com>
- Date
- Mar 28, 2024, 14:53 UTC
- Message-ID
- <CAEYvaskGHYrQgke=gf1sXYhrwbd+SeTpcjGF0fpxK3hQbyPFKg@mail.gmail.com>
Pasting the output of `git bugreport`:
Thank you for filling out a Git bug report! Please answer the following questions to help us understand your issue.
What did you do before the bug happened? (Steps to reproduce your issue)
I created a branch, pushed to a remote, and then the remote deleted the branch. Then I tried to delete the local branch.
What did you expect to happen? (Expected behavior)
The branch to be deleted.
What happened instead? (Actual behavior)
% git branch -d cleanup error: cannot delete branch 'cleanup' used by worktree at '<my source dir>' % git worktree list <my source dir> dc46f6d5e [main] % git branch cleanup * main
What's different between what you expected and what actually happened?
Git reports the branch is being used by a worktree, but prints the current repository's directory, where a different branch is clearly checked out.
Anything else you want to add:
Please review the rest of the bug report below. You can delete any lines you don't wish to share.
[System Info] git version: git version 2.44.0 cpu: arm64 no commit associated with this build sizeof-long: 8 sizeof-size_t: 8 shell-path: /bin/sh feature: fsmonitor--daemon uname: Darwin 23.4.0 Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:25 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T6030 arm64 compiler info: clang: 15.0.0 (clang-1500.1.0.2.5) libc info: no libc information available $SHELL (typically, interactive shell): /bin/zsh
[Enabled Hooks]