merge: a random object may not necssarily be a commit
The user could have said "git merge $(git rev-parse v1.0.0)"; we shouldn't mark it as "Merge commit '15999998fb...'" as the merge name, even though such an invocation might be crazy. We could even read the "tag " header from the tag object and replace the object name the user gave us, but let's not lose the information by doing so, at least not yet. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Junio C Hamano committed
Mar 19, 2013 at 09:55 UTC
2d1495fe449de98df3b0feb5ce508c5f6418d3fa
1 file changed
+13
builtin/merge.c
+13
@@ -516,6 +516,19 @@ static void merge_name(const char *remote, struct strbuf *msg)
516
strbuf_release(&line);
517
goto cleanup;
518
}
519
+
520
+ if (remote_head->util) {
521
+ struct merge_remote_desc *desc;
522
+ desc = merge_remote_util(remote_head);
523
+ if (desc && desc->obj && desc->obj->type == OBJ_TAG) {
524
+ strbuf_addf(msg, "%s\t\t%s '%s'\n",
525
+ sha1_to_hex(desc->obj->sha1),
526
+ typename(desc->obj->type),
527
+ remote);
528
+ goto cleanup;
529
+ }
530
+ }
531
+
532
strbuf_addf(msg, "%s\t\tcommit '%s'\n",
533
sha1_to_hex(remote_head->object.sha1), remote);
534
cleanup: