receive-pack: protect current branch for bare repository worktree
commit9fdf4f1db422cc259e4a3ce0023a255102c6fa3b
authorAnders Kaseorg <andersk@mit.edu>
Wed, 1 Dec 2021 22:15:46 +0000 (1 14:15 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 2 Dec 2021 06:18:25 +0000 (1 22:18 -0800)
treea041ac1de8d1661dbedee3df94834dd453db9781
parent38baae6cfe4ac3af60e127b9e7f9de04c47c4881
receive-pack: protect current branch for bare repository worktree

A bare repository won’t have a working tree at "..", but it may still
have separate working trees created with git worktree. We should protect
the current branch of such working trees from being updated or deleted,
according to receive.denyCurrentBranch.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/receive-pack.c
t/t5516-fetch-push.sh