summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Jeff King <peff@peff.net>2014-06-18 15:42:14 -0400
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-06-18 14:56:54 -0700
commitc0264180d74510669bcec9bb5ff12a145c685b8e (patch)
treeecd1875c4e0e09af61b0b2321e4f1e6f851ed04d
parentdaemon: mark some strings as const (diff)
downloadtgif-c0264180d74510669bcec9bb5ff12a145c685b8e.tar.xz
avoid using skip_prefix as a boolean
There's no point in using: if (skip_prefix(buf, "foo")) over if (starts_with(buf, "foo")) as the point of skip_prefix is to return a pointer to the data after the prefix. Using starts_with is more readable, and will make refactoring skip_prefix easier. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--builtin/fmt-merge-msg.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin/fmt-merge-msg.c b/builtin/fmt-merge-msg.c
index 3906eda877..72378e6810 100644
--- a/builtin/fmt-merge-msg.c
+++ b/builtin/fmt-merge-msg.c
@@ -298,7 +298,7 @@ static void credit_people(struct strbuf *out,
(them->nr == 1 &&
me &&
(me = skip_prefix(me, them->items->string)) != NULL &&
- skip_prefix(me, " <")))
+ starts_with(me, " <")))
return;
strbuf_addf(out, "\n%c %s ", comment_line_char, label);
add_people_count(out, them);