summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-12-17 19:28:02 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-12-17 19:28:54 (GMT)
commit5e519fb8b09378342e23bd8c075cfb4b8e7b0e4f (patch)
tree54e850e494e9bb6d25d99f82aeb03e1f8ec3faff /read-cache.c
parent76f8611a5fb7e81c1bada0fb190d573a66fc03f6 (diff)
parent83332636f575f00edff8f3afb15a2f96885bf417 (diff)
downloadgit-5e519fb8b09378342e23bd8c075cfb4b8e7b0e4f.zip
git-5e519fb8b09378342e23bd8c075cfb4b8e7b0e4f.tar.gz
git-5e519fb8b09378342e23bd8c075cfb4b8e7b0e4f.tar.bz2
Sync with v1.9.5
* maint-1.9: Git 1.9.5 Git 1.8.5.6 fsck: complain about NTFS ".git" aliases in trees read-cache: optionally disallow NTFS .git variants path: add is_ntfs_dotgit() helper fsck: complain about HFS+ ".git" aliases in trees read-cache: optionally disallow HFS+ .git variants utf8: add is_hfs_dotgit() helper fsck: notice .git case-insensitively t1450: refactor ".", "..", and ".git" fsck tests verify_dotfile(): reject .git case-insensitively read-tree: add tests for confusing paths like ".." and ".git" unpack-trees: propagate errors adding entries to the index
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/read-cache.c b/read-cache.c
index 7f5645e..36a6f73 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -14,6 +14,7 @@
#include "resolve-undo.h"
#include "strbuf.h"
#include "varint.h"
+#include "utf8.h"
static struct cache_entry *refresh_cache_entry(struct cache_entry *ce,
unsigned int options);
@@ -756,9 +757,10 @@ static int verify_dotfile(const char *rest)
* 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 */
@@ -782,6 +784,10 @@ int verify_path(const char *path)
return 1;
if (is_dir_sep(c)) {
inside:
+ if (protect_hfs && is_hfs_dotgit(path))
+ return 0;
+ if (protect_ntfs && is_ntfs_dotgit(path))
+ return 0;
c = *path++;
if ((c == '.' && !verify_dotfile(path)) ||
is_dir_sep(c) || c == '\0')