diff --git a/test/update-policy.sh b/test/update-policy.sh index 17d67f8..2117218 100755 --- a/test/update-policy.sh +++ b/test/update-policy.sh @@ -33,7 +33,9 @@ PATH="$dir/bin:$PATH" export PATH # new_repo: a repo with one commit, holding only an older copy of the -# script, so that a run must replace the script that is running. +# script that is shorter than the new one. A run that rewrote the running +# script in place, instead of replacing it, would then read the new +# file's last lines as commands and fail. new_repo() { scenario="$1" rm -rf "$dir/repo" @@ -42,8 +44,8 @@ new_repo() { git config user.name test git config user.email test@example.com mkdir script - cp "$PROMPTS/script/update-policy" script/ - echo "# older copy" >> script/update-policy + grep -v '^# ' "$PROMPTS/script/update-policy" > script/update-policy + chmod +x script/update-policy echo own > README.md git add README.md script/update-policy git commit -q -m initial