summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-11-24 13:40:44 -0500
committerJunio C Hamano <gitster@pobox.com>2014-11-24 12:45:34 -0800
commit95c26ec0f1549cdde6f6c668c6bd0abdec9f9951 (patch)
tree42a62f7010e452917e9eeabd0146b7fb0aef34af
parent9c43412e715be271e75d2cd063ee012085405b9d (diff)
downloadgit-jk/reject-dot-git.tar.gz
fsck: notice .git case-insensitivelyjk/reject-dot-git
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>
-rw-r--r--fsck.c2
-rwxr-xr-xt/t1450-fsck.sh1
2 files changed, 2 insertions, 1 deletions
diff --git a/fsck.c b/fsck.c
index a7233c8d0b..ade1b88596 100644
--- a/fsck.c
+++ b/fsck.c
@@ -170,7 +170,7 @@ static int fsck_tree(struct tree *item, int strict, fsck_error error_func)
has_empty_name |= !*name;
has_dot |= !strcmp(name, ".");
has_dotdot |= !strcmp(name, "..");
- has_dotgit |= !strcmp(name, ".git");
+ has_dotgit |= !strcasecmp(name, ".git");
has_zero_pad |= *(char *)desc.buffer == '0';
update_tree_entry(&desc);
diff --git a/t/t1450-fsck.sh b/t/t1450-fsck.sh
index 292e21b9b7..a441a408e3 100755
--- a/t/t1450-fsck.sh
+++ b/t/t1450-fsck.sh
@@ -277,6 +277,7 @@ done <<-\EOF
dot .
dotdot ..
dotgit .git
+dotgit-case .GIT
EOF
test_done