diff options
-rw-r--r-- | contrib/coccinelle/strbuf.cocci | 6 | ||||
-rw-r--r-- | diff.c | 2 | ||||
-rw-r--r-- | submodule.c | 2 | ||||
-rw-r--r-- | wt-status.c | 3 |
4 files changed, 9 insertions, 4 deletions
diff --git a/contrib/coccinelle/strbuf.cocci b/contrib/coccinelle/strbuf.cocci index 4b7553f833..1e242983cf 100644 --- a/contrib/coccinelle/strbuf.cocci +++ b/contrib/coccinelle/strbuf.cocci @@ -9,3 +9,9 @@ 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); @@ -3086,7 +3086,7 @@ static void fill_metainfo(struct strbuf *msg, } strbuf_addf(msg, "%s%sindex %s..", line_prefix, set, find_unique_abbrev(one->oid.hash, abbrev)); - strbuf_addstr(msg, find_unique_abbrev(two->oid.hash, abbrev)); + strbuf_add_unique_abbrev(msg, two->oid.hash, abbrev); if (one->mode == two->mode) strbuf_addf(msg, " %06o", one->mode); strbuf_addf(msg, "%s\n", reset); diff --git a/submodule.c b/submodule.c index 95a7ac544b..1e28437a5a 100644 --- a/submodule.c +++ b/submodule.c @@ -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 diff --git a/wt-status.c b/wt-status.c index 39470dadf0..fed83e5c82 100644 --- a/wt-status.c +++ b/wt-status.c @@ -1326,8 +1326,7 @@ static int grab_1st_switch(unsigned char *osha1, unsigned char *nsha1, if (!strcmp(cb->buf.buf, "HEAD")) { /* HEAD is relative. Resolve it to the right reflog entry. */ strbuf_reset(&cb->buf); - strbuf_addstr(&cb->buf, - find_unique_abbrev(nsha1, DEFAULT_ABBREV)); + strbuf_add_unique_abbrev(&cb->buf, nsha1, DEFAULT_ABBREV); } return 1; } |