read-tree: narrow scope of index expansion for '--prefix'
[alt-git.git] / t / t6405-merge-symlinks.sh
blob7435fce71e004095c3a9fe181b038ae77a800192
1 #!/bin/sh
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-lib.sh
16 test_expect_success 'setup' '
17 git config core.symlinks false &&
18 >file &&
19 git add file &&
20 git commit -m initial &&
21 git branch b-symlink &&
22 git branch b-file &&
23 l=$(printf file | git hash-object -t blob -w --stdin) &&
24 echo "120000 $l symlink" | git update-index --index-info &&
25 git commit -m main &&
26 git checkout b-symlink &&
27 l=$(printf file-different | git hash-object -t blob -w --stdin) &&
28 echo "120000 $l symlink" | git update-index --index-info &&
29 git commit -m b-symlink &&
30 git checkout b-file &&
31 echo plain-file >symlink &&
32 git add symlink &&
33 git commit -m b-file
36 test_expect_success 'merge main into b-symlink, which has a different symbolic link' '
37 git checkout b-symlink &&
38 test_must_fail git merge main
41 test_expect_success 'the merge result must be a file' '
42 test_path_is_file symlink
45 test_expect_success 'merge main into b-file, which has a file instead of a symbolic link' '
46 git reset --hard &&
47 git checkout b-file &&
48 test_must_fail git merge main
51 test_expect_success 'the merge result must be a file' '
52 test_path_is_file symlink
55 test_expect_success 'merge b-file, which has a file instead of a symbolic link, into main' '
56 git reset --hard &&
57 git checkout main &&
58 test_must_fail git merge b-file
61 test_expect_success 'the merge result must be a file' '
62 test_path_is_file symlink
65 test_done