From: Anders Kaseorg Date: Tue, 09 Nov 2021 22:52:36 GMT Subject: Re: [PATCH v4 1/4] fetch: Protect branches checked out in all worktrees Message-ID: <316e8579-d720-b40e-66fb-3280e8de1922@mit.edu> In-Reply-To: On 11/9/21 08:09, Johannes Schindelin wrote: >> + (wt = find_shared_symref("HEAD", ref_map->peer_ref->name))) > > Do we need `&& !wt->is_bare` here, too? Sure (in the “future-proofing” sense), will add. >> +test_expect_success 'refuse fetch to current branch of worktree' ' >> + test_when_finished "git worktree remove --force wt" && > > Do we also need `&& git branch -D wt` here? Will add. >> + git fetch -u . HEAD:wt > > Maybe even `test_path_exists wt/apple.t`, to verify that the worktree has > been updated? Not here; git fetch -u never updates working trees, not even the main working tree. Is that a bug? I don’t know, but if it is, it’s certainly a separate one. Anders