Try "stg sink" without applied patches
[stgit] / t / t1501-sink.sh
diff --git a/t/t1501-sink.sh b/t/t1501-sink.sh
new file mode 100755 (executable)
index 0000000..3872c4b
--- /dev/null
@@ -0,0 +1,28 @@
+#!/bin/sh
+
+test_description='Test "stg sink"'
+
+. ./test-lib.sh
+
+test_expect_success 'Initialize StGit stack' '
+    echo 000 >> x &&
+    git add x &&
+    git commit -m initial &&
+    echo 000 >> y &&
+    git add y &&
+    git commit -m y &&
+    stg init &&
+    stg uncommit &&
+    stg pop
+'
+
+test_expect_success 'sink without applied patches' '
+    ! stg sink
+'
+
+test_expect_failure 'sink a specific patch without applied patches' '
+    stg sink y &&
+    test $(echo $(stg applied)) = "y"
+'
+
+test_done