Skip to content

Commit 76e86fc

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 450870c commit 76e86fc

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

fsck.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ static int fsck_tree(struct tree *item, int strict, fsck_error error_func)
175175
has_dot = 1;
176176
if (!strcmp(name, ".."))
177177
has_dotdot = 1;
178-
if (!strcmp(name, ".git"))
178+
if (!strcasecmp(name, ".git"))
179179
has_dotgit = 1;
180180
has_zero_pad |= *(char *)desc.buffer == '0';
181181
update_tree_entry(&desc);

t/t1450-fsck.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,6 +263,7 @@ done <<-\EOF
263263
dot .
264264
dotdot ..
265265
dotgit .git
266+
dotgit-case .GIT
266267
EOF
267268

268269
test_done

0 commit comments

Comments
 (0)