mirror of
https://github.com/git/git
synced 2024-08-28 12:09:19 +00:00
![René Scharfe](/assets/img/avatar_default.png)
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>
18 lines
272 B
Plaintext
18 lines
272 B
Plaintext
@@
|
|
expression E1, E2;
|
|
@@
|
|
- strbuf_addf(E1, E2);
|
|
+ strbuf_addstr(E1, E2);
|
|
|
|
@@
|
|
expression E1, E2;
|
|
@@
|
|
- strbuf_addf(E1, "%s", E2);
|
|
+ strbuf_addstr(E1, E2);
|
|
|
|
@@
|
|
expression E1, E2, E3;
|
|
@@
|
|
- strbuf_addstr(E1, find_unique_abbrev(E2, E3));
|
|
+ strbuf_add_unique_abbrev(E1, E2, E3);
|