push: require force for refs under refs/tags/

References are allowed to update from one commit-ish to another if the
former is an ancestor of the latter.  This behavior is oriented to
branches which are expected to move with commits.  Tag references are
expected to be static in a repository, though, thus an update to
something under refs/tags/ should be rejected unless the update is
forced.

Signed-off-by: Chris Rorvick <chris@rorvick.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Chris Rorvick
2012-11-29 19:41:37 -06:00
committed by Junio C Hamano
parent 8c5f6f717d
commit dbfeddb12e
9 changed files with 62 additions and 13 deletions

View File

@ -222,7 +222,7 @@ static const char message_advice_checkout_pull_push[] =
static const char message_advice_ref_already_exists[] =
N_("Updates were rejected because the destination reference already exists\n"
"in the remote and the update is not a fast-forward.");
"in the remote.");
static void advise_pull_before_push(void)
{