Skip to content

Commit aac1d7b

Browse files
Andreas Gruenbachergitster
authored andcommitted
fetch: Check for a "^{}" suffix with suffixcmp()
Otherwise, we will check random bytes for ref names < 3 characters. Signed-off-by: Andreas Gruenbacher <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent e9bd323 commit aac1d7b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin-fetch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ static void find_non_local_tags(struct transport *transport,
588588
* to fetch then we can mark the ref entry in the list
589589
* as one to ignore by setting util to NULL.
590590
*/
591-
if (!strcmp(ref->name + strlen(ref->name) - 3, "^{}")) {
591+
if (!suffixcmp(ref->name, "^{}")) {
592592
if (item && !has_sha1_file(ref->old_sha1) &&
593593
!will_fetch(head, ref->old_sha1) &&
594594
!has_sha1_file(item->util) &&

0 commit comments

Comments
 (0)