Re: [PATCH 3/6] receive-pack: receive.denyDeleteCurrent
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Feb 9, 2009, 21:38 UTC
- Message-ID
- <7veiy7thnv.fsf@gitster.siamese.dyndns.org>
- In-Reply-To
- <20090209192210.GD27037@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 9 quoted lines
> Should the denyCurrentBranch code be triggering at all on a deletion? > > That is, if I have: > > [receive] > denyCurrentBranch = refuse > denyDeleteCurrent = ignore > > should such a deletion be refused or allowed?
I think denyCurrentBranch means do not touch the currently checked out branch, so 'refuse' there should trump whatever denyDeleteCurrent says as long as the repository has a work tree.
Perhaps the logic needs to be restructured to:
if (the push affects the current branch) {
if (in a repository with a work tree) {
decide if we want to refuse or allow;
decide what message to issue;
}
if (deletion and we decided not to refuse) {
decide if we want to refuse or allow;
decide what message to issue;
}
give message(s), possibly with a paragraph break in between;
if (refuse)
refuse;
}