diff options
author | Junio C Hamano <gitster@pobox.com> | 2016-10-28 09:01:23 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2016-10-28 09:01:23 -0700 |
commit | c8fd2201756f9cd10a796311a1b25d7a2ab2a3b9 (patch) | |
tree | 6654ec0ab1a53959fe62fa526445efe71deb0dfb /pretty.c | |
parent | 0582a34f525a95a1c592f111fbf64dd45a4d8e70 (diff) | |
parent | a94bb683970a111b467a36590ca36e52754ad504 (diff) | |
download | git-c8fd2201756f9cd10a796311a1b25d7a2ab2a3b9.tar.gz |
Merge branch 'rs/cocci' into maint
Code cleanup.
* rs/cocci:
use strbuf_add_unique_abbrev() for adding short hashes, part 3
remove unnecessary NULL check before free(3)
coccicheck: make transformation for strbuf_addf(sb, "...") more precise
use strbuf_add_unique_abbrev() for adding short hashes, part 2
use strbuf_addstr() instead of strbuf_addf() with "%s", part 2
gitignore: ignore output files of coccicheck make target
use strbuf_addstr() for adding constant strings to a strbuf, part 2
add coccicheck make target
contrib/coccinelle: fix semantic patch for oid_to_hex_r()
Diffstat (limited to 'pretty.c')
-rw-r--r-- | pretty.c | 12 |
1 files changed, 5 insertions, 7 deletions
@@ -544,15 +544,13 @@ static void add_merge_info(const struct pretty_print_context *pp, strbuf_addstr(sb, "Merge:"); while (parent) { - struct commit *p = parent->item; - const char *hex = NULL; + struct object_id *oidp = &parent->item->object.oid; + strbuf_addch(sb, ' '); if (pp->abbrev) - hex = find_unique_abbrev(p->object.oid.hash, pp->abbrev); - if (!hex) - hex = oid_to_hex(&p->object.oid); + strbuf_add_unique_abbrev(sb, oidp->hash, pp->abbrev); + else + strbuf_addstr(sb, oid_to_hex(oidp)); parent = parent->next; - - strbuf_addf(sb, " %s", hex); } strbuf_addch(sb, '\n'); } |