]> git.ipfire.org Git - thirdparty/git.git/commit - commit.c
Accept tags in HEAD or MERGE_HEAD
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>
Sat, 17 Sep 2011 11:57:45 +0000 (21:57 +1000)
committerJunio C Hamano <gitster@pobox.com>
Sun, 18 Sep 2011 21:11:40 +0000 (14:11 -0700)
commitbaf18fc261ca475343fe3cb9cd2c0dded4bc1bb7
tree666474a67f25d9906b2eace5692d1613beab21a6
parent894642f68d3160db9116ca350da83c4a78cff8f2
Accept tags in HEAD or MERGE_HEAD

HEAD and MERGE_HEAD (among other branch tips) should never hold a
tag. That can only be caused by broken tools and is cumbersome to fix
by an end user with:

  $ git update-ref HEAD $(git rev-parse HEAD^{commit})

which may look like a magic to a new person.

Be easy, warn users (so broken tools can be fixed if they bother to
report) and move on.

Be robust, if the given SHA-1 cannot be resolved to a commit object,
die (therefore return value is always valid).

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/commit.c
builtin/fmt-merge-msg.c
builtin/merge.c
commit.c
commit.h
http-push.c
revision.c