Do not use data_files in setup.py
[stgit.git] / t / t2702-refresh-rm.sh
blobd30572a89f40fc24195270817e503f30f43cd11e
1 #!/bin/sh
3 test_description='"stg refresh" with removed files'
5 . ./test-lib.sh
7 # Ignore our own temp files.
8 cat >> .git/info/exclude <<EOF
9 expected*.txt
10 files*.txt
11 status*.txt
12 EOF
14 test_expect_success 'Initialize StGit stack' '
15 stg init &&
16 echo x > x.txt &&
17 echo y > y.txt &&
18 stg add x.txt y.txt &&
19 git commit -m "Add some files"
22 cat > expected0.txt <<EOF
23 D y.txt
24 EOF
25 printf '' > expected1.txt
26 test_expect_success 'stg rm a file' '
27 test_when_finished "stg pop -a; git reset --hard"
28 stg new -m p0 &&
29 stg rm y.txt &&
30 stg status > status0.txt &&
31 test_cmp expected0.txt status0.txt &&
32 stg refresh &&
33 stg status > status1.txt &&
34 test_cmp expected1.txt status1.txt &&
35 stg files > files.txt &&
36 test_cmp -w expected0.txt files.txt
39 cat > expected0.txt <<EOF
40 M x.txt
41 D y.txt
42 EOF
43 printf '' > expected1.txt
44 test_expect_success 'stg rm a file together with other changes' '
45 test_when_finished "stg pop -a; git reset --hard"
46 stg new -m p1 &&
47 echo x2 >> x.txt &&
48 stg rm y.txt &&
49 stg status > status0.txt &&
50 test_cmp expected0.txt status0.txt &&
51 stg refresh --force &&
52 stg status > status1.txt &&
53 test_cmp expected1.txt status1.txt &&
54 stg files > files.txt &&
55 test_cmp -w expected0.txt files.txt
58 cat > expected0.txt <<EOF
59 D y.txt
60 EOF
61 printf '' > expected1.txt
62 test_expect_success 'rm a file' '
63 test_when_finished "stg pop -a; git reset --hard"
64 stg new -m p2 &&
65 rm y.txt &&
66 stg status > status0.txt &&
67 test_cmp expected0.txt status0.txt &&
68 stg refresh &&
69 stg status > status1.txt &&
70 test_cmp expected1.txt status1.txt &&
71 stg files > files.txt &&
72 test_cmp -w expected0.txt files.txt
75 cat > expected0.txt <<EOF
76 M x.txt
77 D y.txt
78 EOF
79 printf '' > expected1.txt
80 test_expect_success 'rm a file together with other changes' '
81 test_when_finished "stg pop -a; git reset --hard"
82 stg new -m p3 &&
83 echo x2 >> x.txt &&
84 rm y.txt &&
85 stg status > status0.txt &&
86 test_cmp expected0.txt status0.txt &&
87 stg refresh &&
88 stg status > status1.txt &&
89 test_cmp expected1.txt status1.txt &&
90 stg files > files.txt &&
91 test_cmp -w expected0.txt files.txt
94 test_done