]> git.ipfire.org Git - thirdparty/git.git/blame - t/t6025-merge-symlinks.sh
The sixth batch
[thirdparty/git.git] / t / t6025-merge-symlinks.sh
CommitLineData
723024d6
JS
1#!/bin/sh
2#
3# Copyright (c) 2007 Johannes Sixt
4#
5
6test_description='merging symlinks on filesystem w/o symlink support.
7
3604e7c5 8This tests that git merge-recursive writes merge results as plain files
723024d6
JS
9if core.symlinks is false.'
10
11. ./test-lib.sh
12
70789843
SS
13test_expect_success 'setup' '
14 git config core.symlinks false &&
15 >file &&
16 git add file &&
17 git commit -m initial &&
18 git branch b-symlink &&
19 git branch b-file &&
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 &&
29 git add symlink &&
30 git commit -m b-file
31'
32
33test_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
36'
37
38test_expect_success 'the merge result must be a file' '
c513a958 39 test_path_is_file symlink
70789843
SS
40'
41
42test_expect_success 'merge master into b-file, which has a file instead of a symbolic link' '
43 git reset --hard &&
44 git checkout b-file &&
45 test_must_fail git merge master
46'
47
48test_expect_success 'the merge result must be a file' '
c513a958 49 test_path_is_file symlink
70789843
SS
50'
51
52test_expect_success 'merge b-file, which has a file instead of a symbolic link, into master' '
53 git reset --hard &&
54 git checkout master &&
55 test_must_fail git merge b-file
56'
57
58test_expect_success 'the merge result must be a file' '
c513a958 59 test_path_is_file symlink
70789843 60'
723024d6
JS
61
62test_done