]> git.scottworley.com Git - pinch/blobdiff - tests/reject-partially-unpinned.sh
Verify update fails if run before pin
[pinch] / tests / reject-partially-unpinned.sh
diff --git a/tests/reject-partially-unpinned.sh b/tests/reject-partially-unpinned.sh
new file mode 100755 (executable)
index 0000000..5fc61fd
--- /dev/null
@@ -0,0 +1,22 @@
+#!/bin/sh
+
+. ./tests/lib/test-setup.sh
+
+foo_setup
+
+python3 ./pinch.py pin "$conf"
+
+cat >> "$conf" <<EOF
+[bar]
+git_repo = file://$repo
+git_ref = master
+EOF
+
+grep . "$conf"
+
+if python3 ./pinch.py update --dry-run "$conf";then
+  echo "FAIL: Update on an unpinned file should fail"
+  exit 1
+else
+  echo PASS
+fi