git-svn: reduce stat() calls for a backwards compatibility check
[git/dscho.git] / t / t6025-merge-symlinks.sh
blob3c1a6972bd05608d9ed1a244996e7eb72056ed6d
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 . ./test-lib.sh
13 test_expect_success \
14 'setup' '
15 git-config core.symlinks false &&
16 > file &&
17 git-add file &&
18 git-commit -m initial &&
19 git-branch b-symlink &&
20 git-branch b-file &&
21 l=$(echo -n file | git-hash-object -t blob -w --stdin) &&
22 echo "120000 $l symlink" | git-update-index --index-info &&
23 git-commit -m master &&
24 git-checkout b-symlink &&
25 l=$(echo -n file-different | git-hash-object -t blob -w --stdin) &&
26 echo "120000 $l symlink" | git-update-index --index-info &&
27 git-commit -m b-symlink &&
28 git-checkout b-file &&
29 echo plain-file > symlink &&
30 git-add symlink &&
31 git-commit -m b-file'
33 test_expect_failure \
34 'merge master into b-symlink, which has a different symbolic link' '
35 ! git-checkout b-symlink ||
36 git-merge master'
38 test_expect_success \
39 'the merge result must be a file' '
40 test -f symlink'
42 test_expect_failure \
43 'merge master into b-file, which has a file instead of a symbolic link' '
44 ! (git-reset --hard &&
45 git-checkout b-file) ||
46 git-merge master'
48 test_expect_success \
49 'the merge result must be a file' '
50 test -f symlink'
52 test_expect_failure \
53 'merge b-file, which has a file instead of a symbolic link, into master' '
54 ! (git-reset --hard &&
55 git-checkout master) ||
56 git-merge b-file'
58 test_expect_success \
59 'the merge result must be a file' '
60 test -f symlink'
62 test_done