A .gitignore or .dockerignore lacking the canonical last line no longer stops the script: each line the canonical file has never held goes below the fetched content. An .editorconfig lacking it is replaced, unless it has such a line, which stops the script. The stub curl now writes files with no execute bit, as a real download does, so the tests exercise the mode the script sets. Model: opus-5-5
This commit is contained in:
1 parent
9f83f3c1b1
commit
8a25e502f4
3 files changed
+62
-15
No files matched your search
+31
-4
@@ -45,7 +45,7 @@ not_found() {
|
||||
|
||||
serve_file() {
|
||||
[ -f "$canonical/$1" ] || not_found
|
||||
cp "$canonical/$1" "$output"
|
||||
cat "$canonical/$1" > "$output"
|
||||
}
|
||||
|
||||
case "$url" in
|
||||
@@ -703,12 +703,37 @@ test_own_script_stops() {
|
||||
}
|
||||
|
||||
test_gitignore_lacks_canonical_last_line() {
|
||||
start_scenario ".gitignore lacking the canonical last line stops"
|
||||
printf '*.log\n/myapp\n' > "$dir/repo/.gitignore"
|
||||
start_scenario ".gitignore lacking the canonical last line keeps the repo's own line below the canonical content"
|
||||
printf '*.log\n\n# A comment of our own.\n/myapp\n' > "$dir/repo/.gitignore"
|
||||
commit_and_push_fixture .gitignore .prettierrc
|
||||
run_update_policy
|
||||
expect_success
|
||||
expect_file .gitignore << 'EOF'
|
||||
*.log
|
||||
*.tmp
|
||||
|
||||
# Own entries go below this comment.
|
||||
/myapp
|
||||
EOF
|
||||
expect_new_commit_not_pushed
|
||||
}
|
||||
|
||||
test_dockerignore_lacks_canonical_last_line() {
|
||||
start_scenario ".dockerignore lacking the canonical last line drops a line an earlier canonical commit held"
|
||||
echo "**/*.log" > "$dir/repo/.dockerignore"
|
||||
expect_former_canonical_line_replaced .dockerignore ".git"
|
||||
expect_same_as_canonical .dockerignore
|
||||
}
|
||||
|
||||
test_editorconfig_lacks_canonical_last_line() {
|
||||
start_scenario ".editorconfig lacking the canonical last line with a line of its own stops"
|
||||
printf 'root = true\n[*.py]\nindent_size = 2\n' > "$dir/repo/.editorconfig"
|
||||
commit_and_push_fixture .editorconfig .prettierrc
|
||||
run_update_policy
|
||||
expect_failure
|
||||
expect_output ".gitignore lacks this line"
|
||||
expect_output ".editorconfig lacks this line"
|
||||
expect_output "[*.py]"
|
||||
expect_output "indent_size = 2"
|
||||
expect_nothing_written
|
||||
}
|
||||
|
||||
@@ -861,6 +886,8 @@ main() {
|
||||
test_ignored_file_stops
|
||||
test_own_script_stops
|
||||
test_gitignore_lacks_canonical_last_line
|
||||
test_dockerignore_lacks_canonical_last_line
|
||||
test_editorconfig_lacks_canonical_last_line
|
||||
test_fetched_golangci_without_deny_list
|
||||
test_own_golangci_setting_stops
|
||||
test_source_repo_stops
|
||||
|
||||
Reference in new issue
Block a user