aboutsummaryrefslogtreecommitdiff
path: root/wt-status.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-09-15 20:31:00 +0200
committerJunio C Hamano <gitster@pobox.com>2016-09-15 12:23:38 -0700
commita22ae753cb297cb8a1e3ae950ae4415190cd51d5 (patch)
treefca5ed773d854629968db249065e162d9ad61682 /wt-status.c
parent63f0a758a06f9af81717683185016275cb201190 (diff)
downloadgit-a22ae753cb297cb8a1e3ae950ae4415190cd51d5.tar.gz
git-a22ae753cb297cb8a1e3ae950ae4415190cd51d5.tar.xz
use strbuf_addstr() for adding constant strings to a strbuf, part 2
Replace uses of strbuf_addf() for adding strings with more lightweight strbuf_addstr() calls. This makes the intent clearer and avoids potential issues with printf format specifiers. 02962d36845b89145cd69f8bc65e015d78ae3434 already converted six cases, this patch covers eleven 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 'wt-status.c')
-rw-r--r--wt-status.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/wt-status.c b/wt-status.c
index 6225a2d89..39470dadf 100644
--- a/wt-status.c
+++ b/wt-status.c
@@ -367,11 +367,11 @@ static void wt_status_print_change_data(struct wt_status *s,
if (d->new_submodule_commits || d->dirty_submodule) {
strbuf_addstr(&extra, " (");
if (d->new_submodule_commits)
- strbuf_addf(&extra, _("new commits, "));
+ strbuf_addstr(&extra, _("new commits, "));
if (d->dirty_submodule & DIRTY_SUBMODULE_MODIFIED)
- strbuf_addf(&extra, _("modified content, "));
+ strbuf_addstr(&extra, _("modified content, "));
if (d->dirty_submodule & DIRTY_SUBMODULE_UNTRACKED)
- strbuf_addf(&extra, _("untracked content, "));
+ strbuf_addstr(&extra, _("untracked content, "));
strbuf_setlen(&extra, extra.len - 2);
strbuf_addch(&extra, ')');
}