Test operations on hidden patches
[stgit] / t / t1701-goto-hidden.sh
diff --git a/t/t1701-goto-hidden.sh b/t/t1701-goto-hidden.sh
new file mode 100755 (executable)
index 0000000..a3c6e62
--- /dev/null
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+test_description='Test "stg goto" with hidden patches'
+
+. ./test-lib.sh
+
+test_expect_success 'Initialize StGit stack' '
+    stg init &&
+    echo foo > foo.txt &&
+    git add foo.txt &&
+    stg new -m hidden-patch &&
+    stg refresh &&
+    stg pop &&
+    stg hide hidden-patch &&
+    test "$(echo $(stg series --all))" = "! hidden-patch"
+'
+
+test_expect_success 'Refuse to go to a hidden patch' '
+    command_error stg goto hidden-patch &&
+    test "$(echo $(stg series --all))" = "! hidden-patch"
+'
+
+test_done