summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2013-03-19 09:55:34 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2013-03-19 10:59:07 -0700
commit2d1495fe449de98df3b0feb5ce508c5f6418d3fa (patch)
tree49cd26adba4fdfe56288888528c43075b595c74f /builtin
parentGit 1.8.0.3 (diff)
downloadtgif-2d1495fe449de98df3b0feb5ce508c5f6418d3fa.tar.xz
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>
Diffstat (limited to 'builtin')
-rw-r--r--builtin/merge.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/builtin/merge.c b/builtin/merge.c
index 0ec8f0d449..990e90c9a4 100644
--- a/builtin/merge.c
+++ b/builtin/merge.c
@@ -516,6 +516,19 @@ static void merge_name(const char *remote, struct strbuf *msg)
strbuf_release(&line);
goto cleanup;
}
+
+ if (remote_head->util) {
+ struct merge_remote_desc *desc;
+ desc = merge_remote_util(remote_head);
+ if (desc && desc->obj && desc->obj->type == OBJ_TAG) {
+ strbuf_addf(msg, "%s\t\t%s '%s'\n",
+ sha1_to_hex(desc->obj->sha1),
+ typename(desc->obj->type),
+ remote);
+ goto cleanup;
+ }
+ }
+
strbuf_addf(msg, "%s\t\tcommit '%s'\n",
sha1_to_hex(remote_head->object.sha1), remote);
cleanup: