aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2010-03-13 18:17:04 +0100
committerJunio C Hamano <gitster@pobox.com>2010-03-20 09:25:25 -0700
commitaac1d7b88918f39b1b7c5bc0dcf831dcc9d5d8a8 (patch)
tree140e76878e54a878de390b0094daa1d8c70ac224
parente9bd32351078d1f664a1608763a92ab402b255f0 (diff)
downloadgit-aac1d7b88918f39b1b7c5bc0dcf831dcc9d5d8a8.tar.gz
git-aac1d7b88918f39b1b7c5bc0dcf831dcc9d5d8a8.tar.xz
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>
-rw-r--r--builtin-fetch.c2
1 files changed, 1 insertions, 1 deletions
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) &&