From: Andreas Gruenbacher Date: Sat, 13 Mar 2010 17:17:04 +0000 (+0100) Subject: fetch: Check for a "^{}" suffix with suffixcmp() X-Git-Tag: v1.7.0.3~6 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=aac1d7b88918f39b1b7c5bc0dcf831dcc9d5d8a8;p=git.git fetch: Check for a "^{}" suffix with suffixcmp() Otherwise, we will check random bytes for ref names < 3 characters. Signed-off-by: Andreas Gruenbacher Signed-off-by: Junio C Hamano --- diff --git a/builtin-fetch.c b/builtin-fetch.c index b059d652c..0acf80991 100644 --- a/builtin-fetch.c +++ b/builtin-fetch.c @@ -588,7 +588,7 @@ static void find_non_local_tags(struct transport *transport, * to fetch then we can mark the ref entry in the list * as one to ignore by setting util to NULL. */ - if (!strcmp(ref->name + strlen(ref->name) - 3, "^{}")) { + if (!suffixcmp(ref->name, "^{}")) { if (item && !has_sha1_file(ref->old_sha1) && !will_fetch(head, ref->old_sha1) && !has_sha1_file(item->util) &&