3 # Copyright (c) 2007 David Kågedal
6 test_description
='Basic stg status
8 Test that "stg status" works.'
13 # Ignore our own output files.
14 cat > .git
/info
/exclude
<<EOF
19 cat > expected.txt
<<EOF
21 test_expect_success
'Run status on empty' '
22 stg status > output.txt &&
23 test_cmp expected.txt output.txt
26 cat > expected.txt
<<EOF
29 test_expect_success
'Status with an untracked file' '
31 stg status > output.txt &&
32 test_cmp expected.txt output.txt
36 cat > expected.txt
<<EOF
38 test_expect_success
'Status with an empty directory' '
40 stg status > output.txt &&
41 test_cmp expected.txt output.txt
44 cat > expected.txt
<<EOF
47 test_expect_success
'Status with an untracked file in a subdir' '
49 stg status > output.txt &&
50 test_cmp expected.txt output.txt
53 cat > expected.txt
<<EOF
56 test_expect_success
'Status with an added file' '
58 stg status > output.txt &&
59 test_cmp expected.txt output.txt
62 cat > expected.txt
<<EOF
65 test_expect_success
'Status with an added file and -n option' '
66 stg status -n > output.txt &&
67 test_cmp expected.txt output.txt
70 cat > expected.txt
<<EOF
72 test_expect_success
'Status after refresh' '
73 stg new -m "first patch" &&
75 stg status > output.txt &&
76 test_cmp expected.txt output.txt
79 cat > expected.txt
<<EOF
82 test_expect_success
'Status after modification' '
83 echo "wee" >> foo/bar &&
84 stg status > output.txt &&
85 test_cmp expected.txt output.txt
88 cat > expected.txt
<<EOF
90 test_expect_success
'Status after refresh' '
91 stg new -m "second patch" && stg refresh &&
92 stg status > output.txt &&
93 test_cmp expected.txt output.txt
96 test_expect_success
'Add another file' '
102 test_expect_success
'Make a conflicting patch' '
104 stg new -m "third patch" &&
105 echo "woo" >> foo/bar &&
109 cat > expected.txt
<<EOF
116 test_expect_success
'Status after conflicting push' '
117 conflict_old stg push &&
118 stg status > output.txt &&
119 test_cmp expected.txt output.txt
122 cat > expected.txt
<<EOF
125 test_expect_success
'Status of file' '
126 stg status foo/bar > output.txt &&
127 test_cmp expected.txt output.txt
130 cat > expected.txt
<<EOF
133 test_expect_success
'Status of dir' '
134 stg status foo > output.txt &&
135 test_cmp expected.txt output.txt
138 cat > expected.txt
<<EOF
141 test_expect_success
'Status of other file' '
142 stg status fie > output.txt &&
143 test_cmp expected.txt output.txt
146 cat > expected.txt
<<EOF
150 test_expect_success
'Status after resolving the push' '
152 stg status > output.txt &&
153 test_cmp expected.txt output.txt
156 cat > expected.txt
<<EOF
160 test_expect_success
'Status after deleting a file' '
162 stg status > output.txt &&
163 test_cmp expected.txt output.txt
166 cat > expected.txt
<<EOF
169 test_expect_success
'Status of disappeared newborn' '
174 stg status > output.txt &&
175 test_cmp expected.txt output.txt
178 cat > expected.txt
<<EOF
182 test_expect_success
'Status after renaming a file' '
185 stg status > output.txt &&
186 test_cmp expected.txt output.txt
189 test_expect_success
'Status after renaming a file (with rename detection)' '
190 git config stgit.diff-opts -M &&
191 stg status > output.txt &&
192 test_cmp expected.txt output.txt