use strbuf_add_unique_abbrev() for adding short hashes, part 2
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.
1eb47f167d already converted six cases,
this patch covers three more.
A semantic patch for Coccinelle is included for easier checking for
new cases that might be introduced in the future.
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
92d52fab3a
commit
f937d78553
@ -374,7 +374,7 @@ void show_submodule_summary(FILE *f, const char *path,
|
||||
find_unique_abbrev(one, DEFAULT_ABBREV));
|
||||
if (!fast_backward && !fast_forward)
|
||||
strbuf_addch(&sb, '.');
|
||||
strbuf_addstr(&sb, find_unique_abbrev(two, DEFAULT_ABBREV));
|
||||
strbuf_add_unique_abbrev(&sb, two, DEFAULT_ABBREV);
|
||||
if (message)
|
||||
strbuf_addf(&sb, " %s%s\n", message, reset);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user