Thread (1 message) 1 message, 1 author, 2020-02-13

Re: [PATCH 2/3] t5509: initialized `pushee` as bare repository

From: Junio C Hamano <hidden>
Date: 2020-02-13 20:34:17

Junio C Hamano [off-list ref] writes:
"Hariom Verma via GitGitGadget" [off-list ref] writes:
quoted
From: Hariom Verma <redacted>

`receive.denyCurrentBranch` currently has a bug where it allows pushing
into the current branch of a non-bare repository as long as it does not
have any commits.
Can patch 3/3 be split into two, so that the fix would protect an
already populated branch that is checked out anywhere (not in the
primary worktree--which is the bug you are fixing) from getting
updated but still allow an unborn branch to be updated, and then
have patch 4/3 that forbids an update to even an unborn branch
"checked out" in any working tree?  This update to the test can then
become part of patch 4/3.
Oh, another thing.  The patch 4/3 that starts forbidding a push into
a checked out unborn branch should also have a test that makes sure
that such an attempt fails.  IOW, making the test repository used in
the test you changed to a bare one, to allow existing test to still
test what it wants to test, like you did in this patch is OK, but we
would want to have a new test that prepares a repository with the
primary and the secondary worktrees, check out an unborn branch in
each of the worktrees, and make sure receive.denyCurrentBranch would
prevent "git push" to update these branches.

Thanks.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help