3 # Copyright (c) 2007 Johannes Sixt
6 test_description
='merging symlinks on filesystem w/o symlink support.
8 This tests that git merge-recursive writes merge results as plain files
9 if core.symlinks is false.'
11 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
12 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
14 TEST_PASSES_SANITIZE_LEAK
=true
17 test_expect_success
'setup' '
18 git config core.symlinks false &&
21 git commit -m initial &&
22 git branch b-symlink &&
24 l=$(printf file | git hash-object -t blob -w --stdin) &&
25 echo "120000 $l symlink" | git update-index --index-info &&
27 git checkout b-symlink &&
28 l=$(printf file-different | git hash-object -t blob -w --stdin) &&
29 echo "120000 $l symlink" | git update-index --index-info &&
30 git commit -m b-symlink &&
31 git checkout b-file &&
32 echo plain-file >symlink &&
37 test_expect_success
'merge main into b-symlink, which has a different symbolic link' '
38 git checkout b-symlink &&
39 test_must_fail git merge main
42 test_expect_success
'the merge result must be a file' '
43 test_path_is_file symlink
46 test_expect_success
'merge main into b-file, which has a file instead of a symbolic link' '
48 git checkout b-file &&
49 test_must_fail git merge main
52 test_expect_success
'the merge result must be a file' '
53 test_path_is_file symlink
56 test_expect_success
'merge b-file, which has a file instead of a symbolic link, into main' '
59 test_must_fail git merge b-file
62 test_expect_success
'the merge result must be a file' '
63 test_path_is_file symlink