]>
Commit | Line | Data |
---|---|---|
723024d6 JS |
1 | #!/bin/sh |
2 | # | |
3 | # Copyright (c) 2007 Johannes Sixt | |
4 | # | |
5 | ||
6 | test_description='merging symlinks on filesystem w/o symlink support. | |
7 | ||
3604e7c5 | 8 | This tests that git merge-recursive writes merge results as plain files |
723024d6 JS |
9 | if core.symlinks is false.' |
10 | ||
11 | . ./test-lib.sh | |
12 | ||
13 | test_expect_success \ | |
14 | 'setup' ' | |
5be60078 | 15 | git config core.symlinks false && |
723024d6 | 16 | > file && |
5be60078 | 17 | git add file && |
3604e7c5 | 18 | git commit -m initial && |
5be60078 JH |
19 | git branch b-symlink && |
20 | git branch b-file && | |
6ecfd91d | 21 | l=$(printf file | git hash-object -t blob -w --stdin) && |
5be60078 | 22 | echo "120000 $l symlink" | git update-index --index-info && |
3604e7c5 NS |
23 | git commit -m master && |
24 | git checkout b-symlink && | |
6ecfd91d | 25 | l=$(printf file-different | git hash-object -t blob -w --stdin) && |
5be60078 | 26 | echo "120000 $l symlink" | git update-index --index-info && |
3604e7c5 NS |
27 | git commit -m b-symlink && |
28 | git checkout b-file && | |
723024d6 | 29 | echo plain-file > symlink && |
5be60078 | 30 | git add symlink && |
3604e7c5 | 31 | git commit -m b-file' |
723024d6 | 32 | |
41ac414e | 33 | test_expect_success \ |
723024d6 | 34 | 'merge master into b-symlink, which has a different symbolic link' ' |
3604e7c5 NS |
35 | git checkout b-symlink && |
36 | test_must_fail git merge master' | |
723024d6 JS |
37 | |
38 | test_expect_success \ | |
39 | 'the merge result must be a file' ' | |
40 | test -f symlink' | |
41 | ||
41ac414e | 42 | test_expect_success \ |
723024d6 | 43 | 'merge master into b-file, which has a file instead of a symbolic link' ' |
3604e7c5 NS |
44 | git reset --hard && git checkout b-file && |
45 | test_must_fail git merge master' | |
723024d6 JS |
46 | |
47 | test_expect_success \ | |
48 | 'the merge result must be a file' ' | |
49 | test -f symlink' | |
50 | ||
41ac414e | 51 | test_expect_success \ |
723024d6 | 52 | 'merge b-file, which has a file instead of a symbolic link, into master' ' |
3604e7c5 NS |
53 | git reset --hard && |
54 | git checkout master && | |
55 | test_must_fail git merge b-file' | |
723024d6 JS |
56 | |
57 | test_expect_success \ | |
58 | 'the merge result must be a file' ' | |
59 | test -f symlink' | |
60 | ||
61 | test_done |