diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2011-09-17 21:57:45 +1000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2011-09-18 14:11:40 -0700 |
commit | baf18fc261ca475343fe3cb9cd2c0dded4bc1bb7 (patch) | |
tree | 666474a67f25d9906b2eace5692d1613beab21a6 /builtin/fmt-merge-msg.c | |
parent | 894642f68d3160db9116ca350da83c4a78cff8f2 (diff) | |
download | git-baf18fc261ca475343fe3cb9cd2c0dded4bc1bb7.tar.gz |
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>
Diffstat (limited to 'builtin/fmt-merge-msg.c')
-rw-r--r-- | builtin/fmt-merge-msg.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c index 75816329d6..7e2f22589d 100644 --- a/builtin/fmt-merge-msg.c +++ b/builtin/fmt-merge-msg.c @@ -293,7 +293,7 @@ static int do_fmt_merge_msg(int merge_title, struct strbuf *in, struct commit *head; struct rev_info rev; - head = lookup_commit(head_sha1); + head = lookup_commit_or_die(head_sha1, "HEAD"); init_revisions(&rev, NULL); rev.commit_format = CMIT_FMT_ONELINE; rev.ignore_merges = 1; |