From: Eric Sunshine Date: Fri, 02 Feb 2018 12:59:29 GMT Subject: Re: [PATCH 7/7] worktree remove: allow it when $GIT_WORK_TREE is already gone Message-ID: In-Reply-To: <20180124095357.19645-8-pclouds@gmail.com> On Wed, Jan 24, 2018 at 4:53 AM, Nguyễn Thái Ngọc Duy wrote: > [...] > - $GIT_WORK_TREE _can_ be missing if the worktree is locked. In that > case we must not delete $GIT_DIR because the real $GIT_WORK_TREE may > be in a usb stick somewhere. This is already handled because we > check for lock first. > [...] > > Noticed-by: Kaartic Sivaraam > Signed-off-by: Nguyễn Thái Ngọc Duy > --- > diff --git a/t/t2028-worktree-move.sh b/t/t2028-worktree-move.sh > @@ -116,4 +116,12 @@ test_expect_success 'force remove worktree with untracked file' ' > +test_expect_success 'remove missing worktree' ' > + git worktree add to-be-gone && > + test -d .git/worktrees/to-be-gone && > + mv to-be-gone gone && > + git worktree remove to-be-gone && > + test_path_is_missing .git/worktrees/to-be-gone > +' Perhaps there could also be a test to verify that a missing but locked worktree is _not_ removed?