Code

fetch: Check for a "^{}" suffix with suffixcmp()
authorAndreas Gruenbacher <agruen@suse.de>
Sat, 13 Mar 2010 17:17:04 +0000 (18:17 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sat, 20 Mar 2010 16:25:25 +0000 (09:25 -0700)
Otherwise, we will check random bytes for ref names < 3 characters.

Signed-off-by: Andreas Gruenbacher <agruen@suse.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch.c

index b059d652c6c04cc1d09395698b7d00ed793872cb..0acf80991b57226d44305fd51f2c32544130dc91 100644 (file)
@@ -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) &&