@@ -1048,18 +1048,28 @@ test_expect_success 'git cat-file --batch-check --follow-symlinks works for out-
10481048 echo .. >>expect &&
10491049 echo HEAD:dir/subdir/out-of-repo-link-dir | git cat-file --batch-check --follow-symlinks >actual &&
10501050 test_cmp expect actual &&
1051- echo symlink 3 >expect &&
1052- echo ../ >>expect &&
1051+ if test_have_prereq MINGW,SYMLINKS
1052+ then
1053+ test_write_lines "symlink 2" ..
1054+ else
1055+ test_write_lines "symlink 3" ../
1056+ fi >expect &&
10531057 echo HEAD:dir/subdir/out-of-repo-link-dir-trailing | git cat-file --batch-check --follow-symlinks >actual &&
10541058 test_cmp expect actual
10551059'
10561060
10571061test_expect_success ' git cat-file --batch-check --follow-symlinks works for symlinks with internal ..' '
1058- echo HEAD: | git cat-file --batch-check >expect &&
1059- echo HEAD:up-down | git cat-file --batch-check --follow-symlinks >actual &&
1060- test_cmp expect actual &&
1061- echo HEAD:up-down-trailing | git cat-file --batch-check --follow-symlinks >actual &&
1062- test_cmp expect actual &&
1062+ if test_have_prereq !MINGW
1063+ then
1064+ # The `up-down` and `up-down-trailing` symlinks are normalized
1065+ # in MSYS in `winsymlinks` mode and are therefore in a
1066+ # different shape than Git expects them.
1067+ echo HEAD: | git cat-file --batch-check >expect &&
1068+ echo HEAD:up-down | git cat-file --batch-check --follow-symlinks >actual &&
1069+ test_cmp expect actual &&
1070+ echo HEAD:up-down-trailing | git cat-file --batch-check --follow-symlinks >actual &&
1071+ test_cmp expect actual
1072+ fi &&
10631073 echo HEAD:up-down-file | git cat-file --batch-check --follow-symlinks >actual &&
10641074 test_cmp found actual &&
10651075 echo symlink 7 >expect &&
0 commit comments