Replace script/update-policy with a short wget-and-commit script (closes #165) #181

Merged
clawbot merged 5 commits from issue-165-simple-update-policy into next 2026-11-18 23:23:50 +01:00
Showing only changes of commit d8a4a2733a - Show all commits
+4 -1
View File
@@ -51,6 +51,8 @@ new_repo() {
new_repo "a first run writes and commits exactly the listed files" new_repo "a first run writes and commits exactly the listed files"
echo stray > stray.txt echo stray > stray.txt
echo staged >> README.md
git add README.md
script/update-policy > "$dir/output" 2>&1 || fail "exited non-zero" script/update-policy > "$dir/output" 2>&1 || fail "exited non-zero"
[ "$(git rev-list --count HEAD)" = 2 ] || fail "made no single commit" [ "$(git rev-list --count HEAD)" = 2 ] || fail "made no single commit"
[ "$(git show --name-only --format= HEAD | sort)" = \ [ "$(git show --name-only --format= HEAD | sort)" = \
@@ -58,7 +60,8 @@ script/update-policy > "$dir/output" 2>&1 || fail "exited non-zero"
cmp -s docs/REPO_POLICIES.md "$PROMPTS/prompts/REPO_POLICIES.md" || cmp -s docs/REPO_POLICIES.md "$PROMPTS/prompts/REPO_POLICIES.md" ||
fail "REPO_POLICIES.md differs" fail "REPO_POLICIES.md differs"
[ -x script/update-policy ] || fail "script not executable" [ -x script/update-policy ] || fail "script not executable"
[ "$(git status --porcelain)" = "?? stray.txt" ] || fail "tree not clean" [ "$(git status --porcelain)" = "$(printf 'M README.md\n?? stray.txt')" ] ||
fail "changed files outside the list"
scenario="a second run commits nothing" scenario="a second run commits nothing"
script/update-policy > "$dir/output" 2>&1 || fail "exited non-zero" script/update-policy > "$dir/output" 2>&1 || fail "exited non-zero"