From: Junio C Hamano Date: Tue, 13 Feb 2018 21:39:07 +0000 (-0800) Subject: Merge branch 'rs/describe-unique-abbrev' X-Git-Tag: v2.17.0-rc0~127 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/8fe806bcd5ac621e22982c73306e94d26e56cf79?ds=inline;hp=-c Merge branch 'rs/describe-unique-abbrev' Code clean-up. * rs/describe-unique-abbrev: describe: use strbuf_add_unique_abbrev() for adding short hashes --- 8fe806bcd5ac621e22982c73306e94d26e56cf79 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;