From: Anders Kaseorg Date: Tue, 09 Nov 2021 23:03:49 GMT Subject: Re: [PATCH v4 3/4] receive-pack: Protect current branch for bare repository worktree Message-ID: <2f983e36-532f-ac87-9ade-fba4c6b9d276@mit.edu> In-Reply-To: On 11/9/21 08:22, Johannes Schindelin wrote: > While `find_shared_symref()` currently won't return a `worktree` with a > non-zero `is_bare`, to future-proof the code we might want to turn the > `if (worktree)` below (8 lines outside the current diff context) into `if > (worktree && !worktree->is_bare)`. Will do. >> +test_expect_success 'denyCurrentBranch and bare repository worktrees' ' >> + test_when_finished "rm -fr bare.git" && > > While `wt/` will be created inside `bare.git` and therefore be removed, > the branch `wt` won't. Maybe add `&& git branch -D wt`? The branch ‘wt’ is inside bare.git. > I like fruit, too! Apple, banana, grape, yummy. I wonder what's next :-) Yay! > Maybe make sure that `bare.git/wt/grape.t` exists? We do want the worktree > to be updated, after all... Right, I’d forgotten this one. Will do. Thanks all for the helpful reviews! Anders