File 0003-verify_dotfile-reject-.git-case-insensitively.patch of Package git.openSUSE_13.1_Update

From cc2fc7c2f07c4a2aba5a653137ac9b489e05df43 Mon Sep 17 00:00:00 2001
From: Jeff King <peff@peff.net>
Date: Mon, 24 Nov 2014 13:39:12 -0500
Subject: [PATCH 03/11] verify_dotfile(): reject .git case-insensitively

We do not allow ".git" to enter into the index as a path
component, because checking out the result to the working
tree may causes confusion for subsequent git commands.
However, on case-insensitive file systems, ".Git" or ".GIT"
is the same. We should catch and prevent those, too.

Note that technically we could allow this for repos on
case-sensitive filesystems. But there's not much point. It's
unlikely that anybody cares, and it creates a repository
that is unexpectedly non-portable to other systems.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 read-cache.c                   |    5 +++--
 t/t1014-read-tree-confusing.sh |    1 +
 2 files changed, 4 insertions(+), 2 deletions(-)

--- a/read-cache.c
+++ b/read-cache.c
@@ -759,9 +759,10 @@ static int verify_dotfile(const char *re
 	 * shares the path end test with the ".." case.
 	 */
 	case 'g':
-		if (rest[1] != 'i')
+	case 'G':
+		if (rest[1] != 'i' && rest[1] != 'I')
 			break;
-		if (rest[2] != 't')
+		if (rest[2] != 't' && rest[2] != 'T')
 			break;
 		rest += 2;
 	/* fallthrough */
--- a/t/t1014-read-tree-confusing.sh
+++ b/t/t1014-read-tree-confusing.sh
@@ -27,6 +27,7 @@ done <<-\EOF
 .
 ..
 .git
+.GIT
 EOF
 
 test_done
openSUSE Build Service is sponsored by