3 test_description
='"stg refresh" with removed files'
7 # Ignore our own temp files.
8 cat >> .git
/info
/exclude
<<EOF
15 stg pop
-a > /dev
/null
16 git
reset --hard > /dev
/null
19 test_expect_success
'Initialize StGit stack' '
23 stg add x.txt y.txt &&
24 git commit -m "Add some files"
27 cat > expected0.txt
<<EOF
30 printf '' > expected1.txt
31 test_expect_success
'stg rm a file' '
34 stg status > status0.txt &&
35 test_cmp expected0.txt status0.txt &&
37 stg status > status1.txt &&
38 test_cmp expected1.txt status1.txt &&
39 stg files > files.txt &&
40 test_cmp -w expected0.txt files.txt
45 cat > expected0.txt
<<EOF
49 printf '' > expected1.txt
50 test_expect_success
'stg rm a file together with other changes' '
54 stg status > status0.txt &&
55 test_cmp expected0.txt status0.txt &&
57 stg status > status1.txt &&
58 test_cmp expected1.txt status1.txt &&
59 stg files > files.txt &&
60 test_cmp -w expected0.txt files.txt
65 cat > expected0.txt
<<EOF
68 printf '' > expected1.txt
69 test_expect_success
'rm a file' '
72 stg status > status0.txt &&
73 test_cmp expected0.txt status0.txt &&
75 stg status > status1.txt &&
76 test_cmp expected1.txt status1.txt &&
77 stg files > files.txt &&
78 test_cmp -w expected0.txt files.txt
83 cat > expected0.txt
<<EOF
87 printf '' > expected1.txt
88 test_expect_success
'rm a file together with other changes' '
92 stg status > status0.txt &&
93 test_cmp expected0.txt status0.txt &&
95 stg status > status1.txt &&
96 test_cmp expected1.txt status1.txt &&
97 stg files > files.txt &&
98 test_cmp -w expected0.txt files.txt