From: Junio C Hamano Date: Mon, 18 Oct 2021 22:47:58 +0000 (-0700) Subject: Merge branch 'rs/make-verify-path-really-verify-again' X-Git-Tag: v2.34.0-rc0~48 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=a86ed75f32a38d3496fedb2be52816aa36472db1;p=thirdparty%2Fgit.git Merge branch 'rs/make-verify-path-really-verify-again' Recent sparse-index work broke safety against attempts to add paths with trailing slashes to the index, which has been corrected. * rs/make-verify-path-really-verify-again: read-cache: let verify_path() reject trailing dir separators again read-cache: add verify_path_internal() t3905: show failure to ignore sub-repo --- a86ed75f32a38d3496fedb2be52816aa36472db1 diff --cc read-cache.c index a78b88a41b,42d804f962..8a50ff66b3 --- a/read-cache.c +++ b/read-cache.c @@@ -1019,15 -1025,15 +1033,15 @@@ inside } } if (protect_ntfs) { -#ifdef GIT_WINDOWS_NATIVE +#if defined GIT_WINDOWS_NATIVE || defined __CYGWIN__ if (c == '\\') - return 0; + return PATH_INVALID; #endif if (is_ntfs_dotgit(path)) - return 0; + return PATH_INVALID; if (S_ISLNK(mode)) { if (is_ntfs_dotgitmodules(path)) - return 0; + return PATH_INVALID; } } diff --cc t/t3905-stash-include-untracked.sh index dd2cdcc114,c59bcffabb..5390eec4e3 --- a/t/t3905-stash-include-untracked.sh +++ b/t/t3905-stash-include-untracked.sh @@@ -407,19 -405,10 +407,25 @@@ test_expect_success 'stash show --inclu test_i18ngrep "worktree and untracked commit have duplicate entries: tracked" err ' +test_expect_success 'stash show --{include,only}-untracked on stashes without untracked entries' ' + git reset --hard && + git clean -xf && + >tracked && + git add tracked && + git stash && + + git stash show >expect && + git stash show --include-untracked >actual && + test_cmp expect actual && + + git stash show --only-untracked >actual && + test_must_be_empty actual +' + + test_expect_success 'stash -u ignores sub-repository' ' + test_when_finished "rm -rf sub-repo" && + git init sub-repo && + git stash -u + ' + test_done