@matheusbsbs / matheus-bagliano / commits / aac1d7b889
Fork 0

fetch: Check for a "^{}" suffix with suffixcmp()

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>

Andreas Gruenbacher committed Mar 13, 2010 at 18:17 UTC aac1d7b88918f39b1b7c5bc0dcf831dcc9d5d8a8
1 file changed +1 -1
builtin-fetch.c
+1 -1
@@ -588,7 +588,7 @@ static void find_non_local_tags(struct transport *transport,
588 * to fetch then we can mark the ref entry in the list
589 * as one to ignore by setting util to NULL.
590 */
591 - if (!strcmp(ref->name + strlen(ref->name) - 3, "^{}")) {
591 + if (!suffixcmp(ref->name, "^{}")) {
592 if (item && !has_sha1_file(ref->old_sha1) &&
593 !will_fetch(head, ref->old_sha1) &&
594 !has_sha1_file(item->util) &&