Restore `stg sink --nopush` capability
[stgit.git] / t / t1503-float-conflict-2.sh
blobad42ec5a7210fb0262c9a3358e766d38e36bfeb5
1 #!/bin/sh
2 test_description='Test that "stg float" can handle conflicts'
3 . ./test-lib.sh
5 test_expect_success 'Test setup' '
6 stg init &&
7 echo expected.txt >> .git/info/exclude &&
8 echo first line > foo.txt &&
9 git add foo.txt &&
10 git commit -m p0 &&
11 echo foo >> foo.txt &&
12 git add foo.txt &&
13 git commit -m p1 &&
14 echo bar >> bar.txt &&
15 git add bar.txt &&
16 git commit -m p2 &&
17 echo foo2 >> foo.txt &&
18 git add foo.txt &&
19 git commit -m p3 &&
20 stg uncommit -n 4
23 cat > expected.txt <<EOF
24 first line
25 <<<<<<< current
26 =======
27 foo
28 foo2
29 >>>>>>> patched
30 EOF
32 test_expect_success 'Float a patch, causing a conflict two patches down' '
33 conflict stg float p1 &&
34 test "$(echo $(stg series))" = "+ p0 + p2 > p3 - p1" &&
35 test "$(stg id p3)" = "$(git rev-list HEAD~0 -n 1)" &&
36 test "$(stg id p2)" = "$(git rev-list HEAD~1 -n 1)" &&
37 test "$(stg id p0)" = "$(git rev-list HEAD~2 -n 1)" &&
38 test "$(stg status)" = "UU foo.txt" &&
39 test_cmp foo.txt expected.txt
42 test_done