aboutsummaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2014-12-17 11:42:28 -0800
committerJunio C Hamano <gitster@pobox.com>2014-12-17 11:42:28 -0800
commit58f1d950e373afe35ed8661045914d23e973d067 (patch)
tree5cc72572de28cfd1f2e9e6d0b1f6299998f15725 /read-cache.c
parent7fa1365c54c28b3cd9375539f381b54061a1880d (diff)
parent9a8c2b67cd5a51666f2c0ce3fbbdb08b97b79b3d (diff)
downloadgit-58f1d950e373afe35ed8661045914d23e973d067.tar.gz
git-58f1d950e373afe35ed8661045914d23e973d067.tar.xz
Sync with v2.0.5
* maint-2.0: Git 2.0.5 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 6f0057fe6..f04269385 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -16,6 +16,7 @@
#include "varint.h"
#include "split-index.h"
#include "sigchain.h"
+#include "utf8.h"
static struct cache_entry *refresh_cache_entry(struct cache_entry *ce,
unsigned int options);
@@ -775,9 +776,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 */
@@ -801,6 +803,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')