Add a few more values for receive.denyCurrentBranch
commit11da27fa7cc055291facaa36d2abee397a88d5d5
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 16 Feb 2009 20:52:51 +0000 (16 21:52 +0100)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Tue, 6 Dec 2011 00:16:40 +0000 (6 00:16 +0000)
tree791670bf54d071f0e8e411324389bb1f02e5839d
parent555f6c239854c6adc627ef2be5f22d08298187f9
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 right
there, 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.

Surprisingly, 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