fsck: notice .git case-insensitively
We complain about ".git" in a tree because it cannot be loaded into the index or checked out. Since we now also reject ".GIT" case-insensitively, fsck should notice the same, so that errors do not propagate. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Jeff King committed
Nov 24, 2014 at 13:40 UTC
76e86fc6e3523d28e8db00e7b10c33c553d996b8
2 files changed
+2
-1
fsck.c
+1
-1
@@ -175,7 +175,7 @@ static int fsck_tree(struct tree *item, int strict, fsck_error error_func)
175
has_dot = 1;
176
if (!strcmp(name, ".."))
177
has_dotdot = 1;
178
- if (!strcmp(name, ".git"))
178
+ if (!strcasecmp(name, ".git"))
179
has_dotgit = 1;
180
has_zero_pad |= *(char *)desc.buffer == '0';
181
update_tree_entry(&desc);
t/t1450-fsck.sh
+1
@@ -263,6 +263,7 @@ done <<-\EOF
263
dot .
264
dotdot ..
265
dotgit .git
266
+dotgit-case .GIT
267
EOF
268
269
test_done