aboutsummaryrefslogtreecommitdiff
path: root/remote.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 /remote.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 'remote.c')
-rw-r--r--remote.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/remote.c b/remote.c
index d29850a81..ad6c5424e 100644
--- a/remote.c
+++ b/remote.c
@@ -2073,7 +2073,7 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
_("Your branch is based on '%s', but the upstream is gone.\n"),
base);
if (advice_status_hints)
- strbuf_addf(sb,
+ strbuf_addstr(sb,
_(" (use \"git branch --unset-upstream\" to fixup)\n"));
} else if (!ours && !theirs) {
strbuf_addf(sb,
@@ -2086,7 +2086,7 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
ours),
base, ours);
if (advice_status_hints)
- strbuf_addf(sb,
+ strbuf_addstr(sb,
_(" (use \"git push\" to publish your local commits)\n"));
} else if (!ours) {
strbuf_addf(sb,
@@ -2097,7 +2097,7 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
theirs),
base, theirs);
if (advice_status_hints)
- strbuf_addf(sb,
+ strbuf_addstr(sb,
_(" (use \"git pull\" to update your local branch)\n"));
} else {
strbuf_addf(sb,
@@ -2110,7 +2110,7 @@ int format_tracking_info(struct branch *branch, struct strbuf *sb)
ours + theirs),
base, ours, theirs);
if (advice_status_hints)
- strbuf_addf(sb,
+ strbuf_addstr(sb,
_(" (use \"git pull\" to merge the remote branch into yours)\n"));
}
free(base);