From 1eb47f167d65d1d305b9c196a1bb40eb96117cb1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ren=C3=A9=20Scharfe?= Date: Sat, 6 Aug 2016 17:41:01 +0200 Subject: use strbuf_add_unique_abbrev() for adding short hashes Call strbuf_add_unique_abbrev() to add abbreviated hashes to strbufs instead of taking detours through find_unique_abbrev() and its static buffer. This is shorter and a bit more efficient. Signed-off-by: Rene Scharfe Signed-off-by: Junio C Hamano --- builtin/checkout.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'builtin') diff --git a/builtin/checkout.c b/builtin/checkout.c index c3486bdec3..fa08b73c0f 100644 --- a/builtin/checkout.c +++ b/builtin/checkout.c @@ -703,8 +703,7 @@ static int add_pending_uninteresting_ref(const char *refname, static void describe_one_orphan(struct strbuf *sb, struct commit *commit) { strbuf_addstr(sb, " "); - strbuf_addstr(sb, - find_unique_abbrev(commit->object.oid.hash, DEFAULT_ABBREV)); + strbuf_add_unique_abbrev(sb, commit->object.oid.hash, DEFAULT_ABBREV); strbuf_addch(sb, ' '); if (!parse_commit(commit)) pp_commit_easy(CMIT_FMT_ONELINE, commit, sb); -- cgit v1.2.3