Leave working dir and index alone after failed (conflicting) push
[stgit] / t / t0002-status.sh
index 6389a23..24f42cc 100755 (executable)
@@ -107,12 +107,10 @@ test_expect_success 'Make a conflicting patch' '
 '
 
 cat > expected.txt <<EOF
-? foo/bar.ancestor
-? foo/bar.current
-? foo/bar.patched
+A fie
 C foo/bar
 EOF
-test_expect_success 'Status after conflicting push' '
+test_expect_failure 'Status after conflicting push' '
     ! stg push &&
     stg status > output.txt &&
     diff -u expected.txt output.txt
@@ -121,7 +119,7 @@ test_expect_success 'Status after conflicting push' '
 cat > expected.txt <<EOF
 C foo/bar
 EOF
-test_expect_success 'Status of file' '
+test_expect_failure 'Status of file' '
     stg status foo/bar > output.txt &&
     diff -u expected.txt output.txt
 '
@@ -129,12 +127,13 @@ test_expect_success 'Status of file' '
 cat > expected.txt <<EOF
 C foo/bar
 EOF
-test_expect_success 'Status of dir' '
+test_expect_failure 'Status of dir' '
     stg status foo > output.txt &&
     diff -u expected.txt output.txt
 '
 
 cat > expected.txt <<EOF
+A fie
 EOF
 test_expect_success 'Status of other file' '
     stg status fie > output.txt &&
@@ -142,6 +141,7 @@ test_expect_success 'Status of other file' '
 '
 
 cat > expected.txt <<EOF
+A fie
 M foo/bar
 EOF
 test_expect_success 'Status after resolving the push' '
@@ -151,9 +151,22 @@ test_expect_success 'Status after resolving the push' '
 '
 
 cat > expected.txt <<EOF
+A fie
 D foo/bar
 EOF
-test_expect_success 'Status after deleting a file' '
+test_expect_failure 'Status after deleting a file' '
+    rm foo/bar &&
+    stg status > output.txt &&
+    diff -u expected.txt output.txt
+'
+
+cat > expected.txt <<EOF
+D foo/bar
+EOF
+test_expect_failure 'Status of disappeared newborn' '
+    stg refresh &&
+    touch foo/bar &&
+    stg add foo/bar &&
     rm foo/bar &&
     stg status > output.txt &&
     diff -u expected.txt output.txt