X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=log-tree.c;h=c719a6e38597130597083666e5328517b075228e;hb=ed6ce4382b5cb34e98ca3db2f19de82a037da322;hp=61a12a7cb01cbc36e8ed1d1a8997a8ca9bba3b05;hpb=824958e50b250e957998626a21763603ca30e832;p=git.git diff --git a/log-tree.c b/log-tree.c index 61a12a7cb..c719a6e38 100644 --- a/log-tree.c +++ b/log-tree.c @@ -456,6 +456,13 @@ static int which_parent(const unsigned char *sha1, const struct commit *commit) return -1; } +static int is_common_merge(const struct commit *commit) +{ + return (commit->parents + && commit->parents->next + && !commit->parents->next->next); +} + static void show_one_mergetag(struct rev_info *opt, struct commit_extra_header *extra, struct commit *commit) @@ -474,6 +481,11 @@ static void show_one_mergetag(struct rev_info *opt, strbuf_init(&verify_message, 256); if (parse_tag_buffer(tag, extra->value, extra->len)) strbuf_addstr(&verify_message, "malformed mergetag\n"); + else if (is_common_merge(commit) && + !hashcmp(tag->tagged->sha1, + commit->parents->next->item->object.sha1)) + strbuf_addf(&verify_message, + "merged tag '%s'\n", tag->tag); else if ((nth = which_parent(tag->tagged->sha1, commit)) < 0) strbuf_addf(&verify_message, "tag %s names a non-parent %s\n", tag->tag, tag->tagged->sha1); @@ -716,9 +728,7 @@ int log_tree_diff_flush(struct rev_info *opt) static int do_diff_combined(struct rev_info *opt, struct commit *commit) { - unsigned const char *sha1 = commit->object.sha1; - - diff_tree_combined_merge(sha1, opt->dense_combined_merges, opt); + diff_tree_combined_merge(commit, opt->dense_combined_merges, opt); return !opt->loginfo; }