chiark / gitweb /
Cleanup tree_status and use -z
[stgit] / t / t4000-upgrade.sh
1 #!/bin/sh
2 #
3 # Copyright (c) 2007 Karl Hasselström
4 #
5
6 test_description='Make sure that we can use old StGIT repositories'
7
8 . ./test-lib.sh
9
10 for ver in 0.12 0.8; do
11
12     tar zxf ../t4000-upgrade/$ver.tar.gz
13     cd $ver
14
15     test_expect_success \
16         "v$ver: Check the list of applied and unapplied patches" '
17         [ "$(echo $(stg applied))" = "p0 p1 p2" ] &&
18         [ "$(echo $(stg unapplied))" = "p3 p4" ]
19     '
20
21     test_expect_success \
22         "v$ver: Make sure the 'description' file is no longer there" '
23         [ ! -e .git/patches/master/description ] &&
24         [ "$(echo $(git config branch.master.description))" = "cool branch" ]
25     '
26
27     test_expect_success \
28         "v$ver: Make sure the 'current' file is no longer there" '
29         [ ! -e .git/patches/master/current ]
30     '
31
32     test_expect_success \
33         "v$ver: Make sure the base ref is no longer there" '
34         ! git show-ref --verify --quiet refs/bases/master
35     '
36
37     cd ..
38 done
39
40 test_done