Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schindelin <johannes.schindelin@gmx.de>2021-02-12 17:49:55 +0300
committerJohannes Schindelin <johannes.schindelin@gmx.de>2021-02-12 17:49:55 +0300
commit97d1dcb1efb2899a40b42da894f2ead0eb7af7ef (patch)
tree7de169ab45412319a20499c29c8ef1f36d6b7032 /t/t0021-conversion.sh
parent7397ca33730626f682845f8691b39c305535611e (diff)
parent06214d171b10e9474a0233dbc5187fd6b109ff2a (diff)
Sync with 2.24.4
* maint-2.24: Git 2.24.4 Git 2.23.4 Git 2.22.5 Git 2.21.4 Git 2.20.5 Git 2.19.6 Git 2.18.5 Git 2.17.6 unpack_trees(): start with a fresh lstat cache run-command: invalidate lstat cache after a command finished checkout: fix bug that makes checkout follow symlinks in leading path
Diffstat (limited to 't/t0021-conversion.sh')
-rwxr-xr-xt/t0021-conversion.sh81
1 files changed, 81 insertions, 0 deletions
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index 6c6d77b51a..1b5066e35b 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -820,4 +820,85 @@ test_expect_success PERL 'invalid file in delayed checkout' '
grep "error: external filter .* signaled that .unfiltered. is now available although it has not been delayed earlier" git-stderr.log
'
+for mode in 'case' 'utf-8'
+do
+ case "$mode" in
+ case) dir='A' symlink='a' mode_prereq='CASE_INSENSITIVE_FS' ;;
+ utf-8)
+ dir=$(printf "\141\314\210") symlink=$(printf "\303\244")
+ mode_prereq='UTF8_NFD_TO_NFC' ;;
+ esac
+
+ test_expect_success PERL,SYMLINKS,$mode_prereq \
+ "delayed checkout with $mode-collision don't write to the wrong place" '
+ test_config_global filter.delay.process \
+ "\"$TEST_ROOT/rot13-filter.pl\" --always-delay delayed.log clean smudge delay" &&
+ test_config_global filter.delay.required true &&
+
+ git init $mode-collision &&
+ (
+ cd $mode-collision &&
+ mkdir target-dir &&
+
+ empty_oid=$(printf "" | git hash-object -w --stdin) &&
+ symlink_oid=$(printf "%s" "$PWD/target-dir" | git hash-object -w --stdin) &&
+ attr_oid=$(echo "$dir/z filter=delay" | git hash-object -w --stdin) &&
+
+ cat >objs <<-EOF &&
+ 100644 blob $empty_oid $dir/x
+ 100644 blob $empty_oid $dir/y
+ 100644 blob $empty_oid $dir/z
+ 120000 blob $symlink_oid $symlink
+ 100644 blob $attr_oid .gitattributes
+ EOF
+
+ git update-index --index-info <objs &&
+ git commit -m "test commit"
+ ) &&
+
+ git clone $mode-collision $mode-collision-cloned &&
+ # Make sure z was really delayed
+ grep "IN: smudge $dir/z .* \\[DELAYED\\]" $mode-collision-cloned/delayed.log &&
+
+ # Should not create $dir/z at $symlink/z
+ test_path_is_missing $mode-collision/target-dir/z
+ '
+done
+
+test_expect_success PERL,SYMLINKS,CASE_INSENSITIVE_FS \
+"delayed checkout with submodule collision don't write to the wrong place" '
+ git init collision-with-submodule &&
+ (
+ cd collision-with-submodule &&
+ git config filter.delay.process "\"$TEST_ROOT/rot13-filter.pl\" --always-delay delayed.log clean smudge delay" &&
+ git config filter.delay.required true &&
+
+ # We need Git to treat the submodule "a" and the
+ # leading dir "A" as different paths in the index.
+ git config --local core.ignoreCase false &&
+
+ empty_oid=$(printf "" | git hash-object -w --stdin) &&
+ attr_oid=$(echo "A/B/y filter=delay" | git hash-object -w --stdin) &&
+ cat >objs <<-EOF &&
+ 100644 blob $empty_oid A/B/x
+ 100644 blob $empty_oid A/B/y
+ 100644 blob $attr_oid .gitattributes
+ EOF
+ git update-index --index-info <objs &&
+
+ git init a &&
+ mkdir target-dir &&
+ symlink_oid=$(printf "%s" "$PWD/target-dir" | git -C a hash-object -w --stdin) &&
+ echo "120000 blob $symlink_oid b" >objs &&
+ git -C a update-index --index-info <objs &&
+ git -C a commit -m sub &&
+ git submodule add ./a &&
+ git commit -m super &&
+
+ git checkout --recurse-submodules . &&
+ grep "IN: smudge A/B/y .* \\[DELAYED\\]" delayed.log &&
+ test_path_is_missing target-dir/y
+ )
+'
+
test_done