From: Junio C Hamano Date: Thu, 22 Mar 2018 21:24:14 +0000 (-0700) Subject: Merge branch 'rs/describe-unique-abbrev' into maint X-Git-Tag: v2.16.3~20 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/9bcb48912c73c92409e430ad4614d14414a8c5ad?ds=inline;hp=-c Merge branch 'rs/describe-unique-abbrev' into maint Code clean-up. * rs/describe-unique-abbrev: describe: use strbuf_add_unique_abbrev() for adding short hashes --- 9bcb48912c73c92409e430ad4614d14414a8c5ad diff --combined builtin/describe.c index 6fe1c51281,21e37f5dae..c428984706 --- a/builtin/describe.c +++ b/builtin/describe.c @@@ -274,13 -274,10 +274,13 @@@ static void append_name(struct commit_n n->name_checked = 1; } - if (n->tag) + if (n->tag) { + if (all) + strbuf_addstr(dst, "tags/"); strbuf_addstr(dst, n->tag->tag); - else + } else { strbuf_addstr(dst, n->path); + } } static void append_suffix(int depth, const struct object_id *oid, struct strbuf *dst) @@@ -383,7 -380,7 +383,7 @@@ static void describe_commit(struct obje if (!match_cnt) { struct object_id *cmit_oid = &cmit->object.oid; if (always) { - strbuf_addstr(dst, find_unique_abbrev(cmit_oid->hash, abbrev)); + strbuf_add_unique_abbrev(dst, cmit_oid->hash, abbrev); if (suffix) strbuf_addstr(dst, suffix); return;