From: Junio C Hamano Date: Wed, 21 Nov 2018 11:39:02 +0000 (+0900) Subject: Merge branch 'nd/clone-case-smashing-warning' X-Git-Tag: v2.20.0-rc1~3 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/9da9fff14d82e1ce055b664f276a5a96d2f5e946?ds=inline;hp=-c 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 --- 9da9fff14d82e1ce055b664f276a5a96d2f5e946 diff --combined entry.c index 5d136c5d55,d3fb6ee0e3..0a3c451f5f --- a/entry.c +++ b/entry.c @@@ -266,7 -266,7 +266,7 @@@ static int write_entry(struct cache_ent const struct submodule *sub; if (ce_mode_s_ifmt == S_IFREG) { - struct stream_filter *filter = get_stream_filter(ce->name, + struct stream_filter *filter = get_stream_filter(state->istate, ce->name, &ce->oid); if (filter && !streaming_write_entry(ce, path, filter, @@@ -314,14 -314,14 +314,14 @@@ * Convert from git internal format to working tree format */ if (dco && dco->state != CE_NO_DELAY) { - ret = async_convert_to_working_tree(ce->name, new_blob, + ret = async_convert_to_working_tree(state->istate, ce->name, new_blob, size, &buf, dco); if (ret && string_list_has_string(&dco->paths, ce->name)) { free(new_blob); goto delayed; } } else - ret = convert_to_working_tree(ce->name, new_blob, size, &buf); + ret = convert_to_working_tree(state->istate, ce->name, new_blob, size, &buf); if (ret) { free(new_blob); @@@ -404,7 -404,7 +404,7 @@@ static void mark_colliding_entries(cons { 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 +419,7 @@@ 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; @@@ -450,8 -450,7 +450,8 @@@ int checkout_entry(struct cache_entry * if (!check_path(path.buf, path.len, &st, state->base_dir_len)) { const struct submodule *sub; - unsigned changed = ce_match_stat(ce, &st, CE_MATCH_IGNORE_VALID|CE_MATCH_IGNORE_SKIP_WORKTREE); + unsigned changed = ie_match_stat(state->istate, ce, &st, + CE_MATCH_IGNORE_VALID | CE_MATCH_IGNORE_SKIP_WORKTREE); /* * Needs to be checked before !changed returns early, * as the possibly empty directory was not changed diff --combined t/t5601-clone.sh index f1a49e94f5,3888c9751f..c28d51bd59 --- a/t/t5601-clone.sh +++ b/t/t5601-clone.sh @@@ -618,7 -618,7 +618,7 @@@ hex2oct () test_expect_success 'clone on case-insensitive fs' ' git init icasefs && ( - cd icasefs + cd icasefs && o=$(git hash-object -w --stdin