Code

test-lib: make test_expect_code a test command
[git.git] / t / t6020-merge-df.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2005 Fredrik Kuivinen
4 #
6 test_description='Test merge with directory/file conflicts'
7 . ./test-lib.sh
9 test_expect_success 'prepare repository' \
10 'echo "Hello" > init &&
11 git add init &&
12 git commit -m "Initial commit" &&
13 git branch B &&
14 mkdir dir &&
15 echo "foo" > dir/foo &&
16 git add dir/foo &&
17 git commit -m "File: dir/foo" &&
18 git checkout B &&
19 echo "file dir" > dir &&
20 git add dir &&
21 git commit -m "File: dir"'
23 test_expect_success 'Merge with d/f conflicts' '
24         test_expect_code 1 git merge "merge msg" B master
25 '
27 test_expect_success 'F/D conflict' '
28         git reset --hard &&
29         git checkout master &&
30         rm .git/index &&
32         mkdir before &&
33         echo FILE >before/one &&
34         echo FILE >after &&
35         git add . &&
36         git commit -m first &&
38         rm -f after &&
39         git mv before after &&
40         git commit -m move &&
42         git checkout -b para HEAD^ &&
43         echo COMPLETELY ANOTHER FILE >another &&
44         git add . &&
45         git commit -m para &&
47         git merge master
48 '
50 test_done