summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-03-03 15:14:48 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-03-03 15:14:48 +0900
commitd7c5b0cd38a97a874f055ac72d163eb51a67c296 (patch)
tree4ba58c32960dcecc1fedede9c9362f5c10158f08 /read-cache.c
parent3815afa233c3938e6f4b67d2f5551297f0c45509 (diff)
downloadgit-d7c5b0cd38a97a874f055ac72d163eb51a67c296.tar.gz
git-d7c5b0cd38a97a874f055ac72d163eb51a67c296.tar.bz2
git-d7c5b0cd38a97a874f055ac72d163eb51a67c296.zip
Imported Upstream version 2.2.1upstream/2.2.1
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 8f3e9eb3..9cff715d 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -17,6 +17,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);
@@ -776,9 +777,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 */
@@ -802,6 +804,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')