Skip to content

Commit 9da9fff

Browse files
committed
Merge branch 'nd/clone-case-smashing-warning'
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
2 parents 5e8feea + e66ceca commit 9da9fff

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

entry.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ static void mark_colliding_entries(const struct checkout *state,
404404
{
405405
int i, trust_ino = check_stat;
406406

407-
#if defined(GIT_WINDOWS_NATIVE)
407+
#if defined(GIT_WINDOWS_NATIVE) || defined(__CYGWIN__)
408408
trust_ino = 0;
409409
#endif
410410

@@ -419,7 +419,7 @@ static void mark_colliding_entries(const struct checkout *state,
419419
if (dup->ce_flags & (CE_MATCHED | CE_VALID | CE_SKIP_WORKTREE))
420420
continue;
421421

422-
if ((trust_ino && dup->ce_stat_data.sd_ino == st->st_ino) ||
422+
if ((trust_ino && !match_stat_data(&dup->ce_stat_data, st)) ||
423423
(!trust_ino && !fspathcmp(ce->name, dup->name))) {
424424
dup->ce_flags |= CE_MATCHED;
425425
break;

t/t5601-clone.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -628,7 +628,7 @@ test_expect_success 'clone on case-insensitive fs' '
628628
)
629629
'
630630

631-
test_expect_success !MINGW,!CYGWIN,CASE_INSENSITIVE_FS 'colliding file detection' '
631+
test_expect_success !MINGW,CASE_INSENSITIVE_FS 'colliding file detection' '
632632
grep X icasefs/warning &&
633633
grep x icasefs/warning &&
634634
test_i18ngrep "the following paths have collided" icasefs/warning

0 commit comments

Comments
 (0)