Skip to content

Commit

Permalink
fetch: Check for a "^{}" suffix with suffixcmp()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Andreas Gruenbacher authored and Junio C Hamano committed Mar 20, 2010
1 parent e9bd323 commit aac1d7b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion builtin-fetch.c
Original file line number Diff line number Diff line change
Expand Up @@ -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) &&
Expand Down

0 comments on commit aac1d7b

Please sign in to comment.