Thread (8 messages) flat view 8 messages, 3 authors, 2016-07-09

Re: git branch doesn't allow me to forcibly delete branch which was checked out in a now-deleted worktree dir

From: Duy Nguyen <hidden>
Date: 2016-07-09 05:34:00

On Thu, Jul 7, 2016 at 8:44 PM, Erik Johnson [off-list ref] wrote:
% git branch -D archive-extracted-xz
error: Cannot delete branch 'archive-extracted-xz' checked out at
'/home/erik/git/salt/archive-extracted-xz'
This is from commit f292244 (branch -d: refuse deleting a branch which
is currently checked out - 2016-03-29) which is about -d not -D, so
it's probably an oversight. I think -D, as a forced form, should allow
deleting branches on other worktrees, we could simply detach the
worktree first.

It's worth noting that before that commit, -D refuses to delete branch
on current worktree as well and f292244 simply applies the same
behavior on other worktrees. If we change the -D behavior about
deleting branches on other worktrees, we may need to consider to keep
the behavior on current branch, or treat it equally as any other
worktrees.
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help