Re: [PATCH 2/3] t5509: initialized `pushee` as bare repository
- From
Johannes Schindelin <johannes.schindelin@gmx.de>
- Date
- Feb 14, 2020, 11:59 UTC
- Message-ID
- <nycvar.QRO.7.76.6.2002141252050.46@tvgsbejvaqbjf.bet>
- In-Reply-To
- <xmqqsgjeqm6w.fsf@gitster-ct.c.googlers.com>
Hi Junio,
On Thu, 13 Feb 2020, Junio C Hamano wrote:
Show 9 quoted lines
> "Hariom Verma via GitGitGadget" <gitgitgadget@gmail.com> writes: > > > From: Hariom Verma <hariom18599@gmail.com> > > > > `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,
I actually don't think so. The `refs_resolve_unsafe()` function simply requires a tip commit, so it is the wrong function to call in this context. And the fix for it is to use a more appropriate function, which 3/3 already does (although for an unrelated reason).
In other words, a fix for one bug would be a fix for the other, and (probably) vice versa.
Show 6 quoted lines
> 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.
I agree that this merits a regression test.
Thanks, Dscho
> > Thanks. >