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.'
13 test_expect_success 'setup' '
14 git config core.symlinks false &&
17 git commit -m initial &&
18 git branch b-symlink &&
20 l=$(printf file | git hash-object -t blob -w --stdin) &&
21 echo "120000 $l symlink" | git update-index --index-info &&
22 git commit -m master &&
23 git checkout b-symlink &&
24 l=$(printf file-different | git hash-object -t blob -w --stdin) &&
25 echo "120000 $l symlink" | git update-index --index-info &&
26 git commit -m b-symlink &&
27 git checkout b-file &&
28 echo plain-file >symlink &&
33 test_expect_success 'merge master into b-symlink, which has a different symbolic link' '
34 git checkout b-symlink &&
35 test_must_fail git merge master
38 test_expect_success 'the merge result must be a file' '
39 test_path_is_file symlink
42 test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '
44 git checkout b-file &&
45 test_must_fail git merge master
48 test_expect_success 'the merge result must be a file' '
49 test_path_is_file symlink
52 test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '
54 git checkout master &&
55 test_must_fail git merge b-file
58 test_expect_success 'the merge result must be a file' '
59 test_path_is_file symlink