]> git.ipfire.org Git - thirdparty/git.git/commit - connect.c
connect: simplify check_ref() using skip_prefix() and starts_with()
authorRené Scharfe <l.s.r@web.de>
Sat, 30 Aug 2014 09:46:54 +0000 (11:46 +0200)
committerJunio C Hamano <gitster@pobox.com>
Tue, 2 Sep 2014 17:36:42 +0000 (10:36 -0700)
commitbe0b3f822b6375028b25f62894056e63cb7c3ce4
tree4a5b9b9a2bb6d472f4a5e57a402c27d3996910e9
parent96db324a73fdada6fbe7b63221986f8f18cc63b0
connect: simplify check_ref() using skip_prefix() and starts_with()

Both callers of check_ref() pass in NUL-terminated strings for name.
Remove the len parameter and then use skip_prefix() and starts_with()
instead of memcmp() to check if it starts with certain strings.  This
gets rid of several magic string length constants and a strlen() call.

Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
connect.c