use skip_prefix to avoid repeating strings
commit95b567c7c3cf6b85d74b79424cdfbd40a7dee7c9
authorJeff King <peff@peff.net>
Wed, 18 Jun 2014 19:48:29 +0000 (18 15:48 -0400)
committerJunio C Hamano <gitster@pobox.com>
Fri, 20 Jun 2014 17:44:45 +0000 (20 10:44 -0700)
treee150b9f71b846bb3245577b55b9ba536bf5a6bfd
parentae021d87911da4328157273df24779892cb51277
use skip_prefix to avoid repeating strings

It's a common idiom to match a prefix and then skip past it
with strlen, like:

  if (starts_with(foo, "bar"))
  foo += strlen("bar");

This avoids magic numbers, but means we have to repeat the
string (and there is no compiler check that we didn't make a
typo in one of the strings).

We can use skip_prefix to handle this case without repeating
ourselves.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/checkout.c
builtin/fmt-merge-msg.c
builtin/log.c
diff.c
help.c
merge-recursive.c
pretty.c
remote-curl.c
remote.c
sha1_name.c