Package: git / 1:2.11.0-3+deb9u4

verify_dotfile-mention-case-insensitivity-in-comment.diff Patch series | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
From 62c36347cce0ea3a3bbbfc782e3363c24e7c0502 Mon Sep 17 00:00:00 2001
From: Jeff King <peff@peff.net>
Date: Tue, 15 May 2018 09:56:50 -0400
Subject: verify_dotfile: mention case-insensitivity in comment

commit 641084b618ddbe099f0992161988c3e479ae848b upstream.

We're more restrictive than we need to be in matching ".GIT"
on case-sensitive filesystems; let's make a note that this
is intentional.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
---
 read-cache.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/read-cache.c b/read-cache.c
index 81479c4abd..c7285167d0 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -818,7 +818,10 @@ static int verify_dotfile(const char *rest)
 
 	switch (*rest) {
 	/*
-	 * ".git" followed by NUL or slash is bad.
+	 * ".git" followed by NUL or slash is bad. Note that we match
+	 * case-insensitively here, even if ignore_case is not set.
+	 * This outlaws ".GIT" everywhere out of an abundance of caution,
+	 * since there's really no good reason to allow it.
 	 */
 	case 'g':
 	case 'G':
-- 
2.17.0.921.gf22659ad46