stgit.el: Break out stgit-sort-patches to a separate function for future reuse
[stgit] / t / t1203-push-conflict.sh
CommitLineData
59c97ab4
DK
1#!/bin/sh
2#
3# Copyright (c) 2006 David Kågedal
4#
5
6test_description='Exercise push conflicts.
7
8Test that the index has no modifications after a push with conflicts.
9'
10
11. ./test-lib.sh
12
13test_expect_success \
14 'Initialize the StGIT repository' \
15 'stg init
16'
17
18test_expect_success \
19 'Create the first patch' \
20 '
21 stg new foo -m foo &&
22 echo foo > test &&
23 echo fie > test2 &&
ea5b7bf3 24 git add test test2 &&
59c97ab4
DK
25 stg refresh &&
26 stg pop
27 '
28
29test_expect_success \
30 'Create the second patch' \
31 '
32 stg new bar -m bar &&
33 echo bar > test &&
ea5b7bf3 34 git add test &&
59c97ab4
DK
35 stg refresh
36 '
37
38test_expect_success \
39 'Push the first patch with conflict' \
40 '
f03004e2 41 conflict_old stg push foo
59c97ab4
DK
42 '
43
44test_expect_success \
45 'Show the, now empty, first patch' \
46 '
47 ! stg show foo | grep -q -e "^diff "
48 '
49
50test_expect_success \
51 'Check that the index has the non-conflict updates' \
52 '
53 git diff --cached --stat | grep -q -e "^ test2 | *1 "
54 '
55
56test_expect_success \
d4f2b3e9
DK
57 'Check that pop will fail while there are unmerged conflicts' \
58 '
f03004e2 59 command_error stg pop
d4f2b3e9
DK
60 '
61
62test_expect_success \
59c97ab4
DK
63 'Resolve the conflict' \
64 '
65 echo resolved > test &&
66 git add test &&
67 stg refresh
68 '
69
70test_done