Commit | Line | Data |
---|---|---|
92330914 KH |
1 | #!/bin/sh |
2 | ||
3 | test_description='Try a push that requires merging a file that is dirty' | |
4 | ||
5 | . ./test-lib.sh | |
6 | ||
7 | test_expect_success 'Initialize StGit stack with two patches' ' | |
8 | stg init && | |
9 | touch a && | |
c7506039 | 10 | stg add a && |
92330914 KH |
11 | git commit -m a && |
12 | echo 1 > a && | |
13 | git commit -a -m p1 && | |
14 | echo 2 > a && | |
15 | git commit -a -m p2 && | |
16 | stg uncommit -n 2 | |
17 | ' | |
18 | ||
19 | test_expect_success 'Pop one patch and update the other' ' | |
20 | stg goto p1 && | |
21 | echo 3 > a && | |
22 | stg refresh | |
23 | ' | |
24 | ||
363d432f | 25 | test_expect_success 'Push with dirty worktree' ' |
92330914 | 26 | echo 4 > a && |
f9d9a062 CM |
27 | [ "$(echo $(stg series --applied --noprefix))" = "p1" ] && |
28 | [ "$(echo $(stg series --unapplied --noprefix))" = "p2" ] && | |
ee11a289 | 29 | conflict stg goto --keep p2 && |
f9d9a062 CM |
30 | [ "$(echo $(stg series --applied --noprefix))" = "p1" ] && |
31 | [ "$(echo $(stg series --unapplied --noprefix))" = "p2" ] && | |
92330914 KH |
32 | [ "$(echo $(cat a))" = "4" ] |
33 | ' | |
34 | ||
35 | test_done |