Skip to content

Fix t2040 #2415

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 25, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 8 additions & 13 deletions t/t2040-checkout-symlink-attr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,14 +23,6 @@ cache_symlink () {
git update-index --add --cacheinfo 120000,$sha,"$2"
}

# MSYS2 is very forgiving, it will resolve symlinks even if the
# symlink type isn't correct. To make this test meaningful, try
# them with a native, non-MSYS executable.
cat_native () {
filename=$(cygpath -w "$1") &&
cmd.exe /c "type \"$filename\""
}

test_expect_success 'checkout symlinks with attr' '
cache_symlink file1 file-link &&
cache_symlink dir dir-link &&
Expand All @@ -41,11 +33,14 @@ test_expect_success 'checkout symlinks with attr' '
git checkout . &&

mkdir dir &&
echo "contents1" >file1 &&
echo "contents2" >dir/file2 &&

test "$(cat_native file-link)" = "contents1" &&
test "$(cat_native dir-link/file2)" = "contents2"
echo "[a]b=c" >file1 &&
echo "[x]y=z" >dir/file2 &&

# MSYS2 is very forgiving, it will resolve symlinks even if the
# symlink type is incorrect. To make this test meaningful, try
# them with a native, non-MSYS executable, such as `git config`.
test "$(git config -f file-link a.b)" = "c" &&
test "$(git config -f dir-link/file2 x.y)" = "z"
'

test_done