debian/rules should be producing architecture independent packages
[stgit/dwhite.git] / t / t1202-push-undo.sh
blob544fe8d1a2d5f1ca24bb3163aedf24f0c24f61c2
1 #!/bin/sh
3 # Copyright (c) 2006 Catalin Marinas
6 test_description='Exercise push --undo with missing files.
8 Test the case where a patch fails to be pushed because it modifies a
9 missing file. The "push --undo" command has to be able to revert it.
12 . ./test-lib.sh
14 test_expect_success \
15 'Initialize the StGIT repository' \
16 'stg init
19 test_expect_success \
20 'Create the first patch' \
22 stg new foo -m foo &&
23 echo foo > test &&
24 git add test &&
25 stg refresh
28 test_expect_success \
29 'Create the second patch' \
31 stg new bar -m bar &&
32 echo bar > test &&
33 git add test &&
34 stg refresh
37 test_expect_success \
38 'Pop all patches' \
40 stg pop --all
43 test_expect_success \
44 'Push the second patch with conflict' \
46 conflict_old stg push bar
49 test_expect_success \
50 'Undo the previous push' \
52 stg push --undo
55 test_expect_success \
56 'Check the push after undo fails as well' \
58 conflict_old stg push bar
61 test_expect_success \
62 'Undo with disappeared newborn' \
64 touch newfile &&
65 git add newfile &&
66 rm newfile &&
67 stg push --undo
70 test_done