Add a few more values for receive.denyCurrentBranch
commite0d730b0f36c9654202366c41ff2a11e209a2f7b
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 16 Feb 2009 20:52:51 +0000 (16 21:52 +0100)
committerStepan Kasal <kasal@ucw.cz>
Wed, 16 Apr 2014 14:31:59 +0000 (16 16:31 +0200)
tree5cd4a76888c831d0a3c9d11e23ffb2d0146bc12a
parentd4c36517ad7e3a3537719a79f95e48d1e0caf64a
Add a few more values for receive.denyCurrentBranch

For a long time, this developer thought that Git's insistence that
pushing into the current branch is evil was completely merited.

Just for fun, the original patch tried to show people that Git is
correct to forbid that, and that it causes more trouble than it does
good when Git allows you to try to update the working tree for
fast-forwards, or to detach the HEAD, depending on some config settings.

To the developer's surprise, the opposite was shown.

So here is the support for two new options you can give the config
variable receive.denyCurrentBranch:

'updateInstead':
Try to merge the working tree with the new tip of the branch
(which can lead to really horrible merge conflicts).

'detachInstead':
Detach the HEAD, thereby avoiding a disagreement between the
HEAD and the index (as well as the working tree), possibly
leaving the local user wondering how on earth her HEAD became
so detached.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Documentation/config.txt
builtin/receive-pack.c
t/t5516-fetch-push.sh