Merge branch 'nd/clone-case-smashing-warning'
authorJunio C Hamano <gitster@pobox.com>
Wed, 21 Nov 2018 11:39:02 +0000 (20:39 +0900)
committerJunio C Hamano <gitster@pobox.com>
Wed, 21 Nov 2018 11:39:03 +0000 (20:39 +0900)
Recently added check for case smashing filesystems did not
correctly utilize the cached stat information, leading to false
breakage detected by our test suite, which has been corrected.

* nd/clone-case-smashing-warning:
clone: fix colliding file detection on APFS

entry.c
t/t5601-clone.sh
diff --git a/entry.c b/entry.c
index 5d136c5d55e0811b70fdb10f59ea506ceb1b273b..0a3c451f5f0f08deabe20b4ca1858825f2b29f3f 100644 (file)
--- a/entry.c
+++ b/entry.c
@@ -404,7 +404,7 @@ static void mark_colliding_entries(const struct checkout *state,
 {
        int i, trust_ino = check_stat;
 
-#if defined(GIT_WINDOWS_NATIVE)
+#if defined(GIT_WINDOWS_NATIVE) || defined(__CYGWIN__)
        trust_ino = 0;
 #endif
 
@@ -419,7 +419,7 @@ static void mark_colliding_entries(const struct checkout *state,
                if (dup->ce_flags & (CE_MATCHED | CE_VALID | CE_SKIP_WORKTREE))
                        continue;
 
-               if ((trust_ino && dup->ce_stat_data.sd_ino == st->st_ino) ||
+               if ((trust_ino && !match_stat_data(&dup->ce_stat_data, st)) ||
                    (!trust_ino && !fspathcmp(ce->name, dup->name))) {
                        dup->ce_flags |= CE_MATCHED;
                        break;
index f1a49e94f5fe56a0c175b0e5354ce1d5300cb382..c28d51bd59259a3cf2ceb7b3b14e5171901145b2 100755 (executable)
@@ -628,7 +628,7 @@ test_expect_success 'clone on case-insensitive fs' '
        )
 '
 
-test_expect_success !MINGW,!CYGWIN,CASE_INSENSITIVE_FS 'colliding file detection' '
+test_expect_success !MINGW,CASE_INSENSITIVE_FS 'colliding file detection' '
        grep X icasefs/warning &&
        grep x icasefs/warning &&
        test_i18ngrep "the following paths have collided" icasefs/warning