worktree: delete .git/worktrees if empty after 'remove'
commit3a5404333c6c8b5897e78c9dcb711d623035791b
authorEric Sunshine <sunshine@sunshineco.com>
Tue, 28 Aug 2018 21:20:26 +0000 (28 17:20 -0400)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Aug 2018 16:28:02 +0000 (30 09:28 -0700)
tree30604b281cb194ab54045d65faa2dc0df71bd2a3
parentf4143101cbb26d189f63f2d29875f4acc07b2730
worktree: delete .git/worktrees if empty after 'remove'

For cleanliness, "git worktree prune" deletes the .git/worktrees
directory if it is empty after pruning is complete.

For consistency, make "git worktree remove <path>" likewise delete
.git/worktrees if it is empty after the removal.

Signed-off-by: Eric Sunshine <sunshine@sunshineco.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/worktree.c
t/t2028-worktree-move.sh