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 diff -u expected.txt output.txt
26 cat > expected.txt
<<EOF
29 test_expect_success
'Status with an untracked file' '
31 stg status > output.txt &&
32 diff -u expected.txt output.txt
36 cat > expected.txt
<<EOF
38 test_expect_success
'Status with an empty directory' '
40 stg status > output.txt &&
41 diff -u 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 diff -u expected.txt output.txt
53 cat > expected.txt
<<EOF
56 test_expect_success
'Status with an added file' '
58 stg status > output.txt &&
59 diff -u 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 diff -u 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 diff -u 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 diff -u 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 diff -u 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
115 test_expect_success
'Status after conflicting push' '
117 stg status > output.txt &&
118 diff -u expected.txt output.txt
121 cat > expected.txt
<<EOF
124 test_expect_success
'Status of file' '
125 stg status foo/bar > output.txt &&
126 diff -u expected.txt output.txt
129 cat > expected.txt
<<EOF
131 test_expect_success
'Status of dir' '
132 stg status foo > output.txt &&
133 diff -u expected.txt output.txt
136 cat > expected.txt
<<EOF
138 test_expect_success
'Status of other file' '
139 stg status fie > output.txt &&
140 diff -u expected.txt output.txt
143 cat > expected.txt
<<EOF
146 test_expect_success
'Status after resolving the push' '
148 stg status > output.txt &&
149 diff -u expected.txt output.txt
152 cat > expected.txt
<<EOF
155 test_expect_success
'Status after deleting a file' '
157 stg status > output.txt &&
158 diff -u expected.txt output.txt