summaryrefslogtreecommitdiff
path: root/submodule.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-09-27 19:08:21 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-09-27 21:02:40 (GMT)
commit92d52fab3af8b1d5231285ac13b364f008d1a886 (patch)
treed7f4350b084aee1109cb4fe328b2892a16026e34 /submodule.c
parent7f2817daef616e764afaaf302f85beb7a13e56dc (diff)
downloadgit-92d52fab3af8b1d5231285ac13b364f008d1a886.zip
git-92d52fab3af8b1d5231285ac13b364f008d1a886.tar.gz
git-92d52fab3af8b1d5231285ac13b364f008d1a886.tar.bz2
use strbuf_addstr() instead of strbuf_addf() with "%s", part 2
Replace uses of strbuf_addf() for adding strings with more lightweight strbuf_addstr() calls. This is shorter and makes the intent clearer. bc57b9c0cc5a123365a922fa1831177e3fd607ed already converted three cases, this patch covers two 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>
Diffstat (limited to 'submodule.c')
-rw-r--r--submodule.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/submodule.c b/submodule.c
index 1b5cdfb..95a7ac5 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_addf(&sb, "%s", find_unique_abbrev(two, DEFAULT_ABBREV));
+ strbuf_addstr(&sb, find_unique_abbrev(two, DEFAULT_ABBREV));
if (message)
strbuf_addf(&sb, " %s%s\n", message, reset);
else