receive-pack: explain what to do when push updates the current branch
This makes "git push" issue a more detailed instruction when a user pushes
into the current branch of a non-bare repository without having an
explicit configuration set to receive.denycurrentbranch. In such a case,
it will also tell the user that the default will change to refusal in a
future version of git.
Signed-off-by: Junio C Hamano <gitster@pobox.com>
@ -492,7 +492,7 @@ test_expect_success 'warn on push to HEAD of non-bare repository' '
@@ -492,7 +492,7 @@ test_expect_success 'warn on push to HEAD of non-bare repository' '
git checkout master &&
git config receive.denyCurrentBranch warn) &&
git push testrepo master 2>stderr &&
grep "warning.*this may cause confusion" stderr
grep "warning: updating the current branch" stderr
'
test_expect_success 'deny push to HEAD of non-bare repository' '
@ -510,7 +510,7 @@ test_expect_success 'allow push to HEAD of bare repository (bare)' '
@@ -510,7 +510,7 @@ test_expect_success 'allow push to HEAD of bare repository (bare)' '
git config receive.denyCurrentBranch true &&
git config core.bare true) &&
git push testrepo master 2>stderr &&
! grep "warning.*this may cause confusion" stderr
! grep "warning: updating the current branch" stderr
'
test_expect_success 'allow push to HEAD of non-bare repository (config)' '
@ -520,7 +520,7 @@ test_expect_success 'allow push to HEAD of non-bare repository (config)' '
@@ -520,7 +520,7 @@ test_expect_success 'allow push to HEAD of non-bare repository (config)' '
git config receive.denyCurrentBranch false
) &&
git push testrepo master 2>stderr &&
! grep "warning.*this may cause confusion" stderr
! grep "warning: updating the current branch" stderr