diff options
author | Junio C Hamano <gitster@pobox.com> | 2013-04-24 16:14:06 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-04-24 16:14:06 -0700 |
commit | 499231d9f157d0987d8bdad258ce4cfd9f4c3d1f (patch) | |
tree | 01926d529ede0e2d5285b8128aa3aaa80c43aa92 /builtin | |
parent | 7612e61e33981f48f212f6aefe3550ac724d6208 (diff) | |
parent | a38d3d76b6d1c70b566633e1629aa3b0e856810e (diff) | |
download | git-499231d9f157d0987d8bdad258ce4cfd9f4c3d1f.tar.gz git-499231d9f157d0987d8bdad258ce4cfd9f4c3d1f.tar.xz |
Merge branch 'jc/merge-tag-object' into maint
"git merge $(git rev-parse v1.8.2)" behaved quite differently from
"git merge v1.8.2", as if v1.8.2 were written as v1.8.2^0 and did
not pay much attention to the annotated tag payload. Make the code
notice the type of the tag object, in addition to the dwim_ref()
based classification the current code uses (i.e. the name appears in
refs/tags/) to decide when to special case merging of tags.
* jc/merge-tag-object:
t6200: test message for merging of an annotated tag
t6200: use test_config/test_unconfig
merge: a random object may not necssarily be a commit
Diffstat (limited to 'builtin')
-rw-r--r-- | builtin/merge.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/builtin/merge.c b/builtin/merge.c index 7c8922c8b..0d94d89e7 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: |