Fail sqlc-check when git status itself fails
CI / ci (push) Successful in 8m5s
CI / ci (pull_request) Successful in 8m11s

An erroring git status printed nothing, which the drift check read as a
clean tree and passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-11 00:06:52 -04:00
co-authored by Claude Opus 5.5
parent 759fbbe3dd
commit cebf8b4d79
+3 -2
View File
@@ -82,7 +82,8 @@ sqlc:
$(SQLC) generate
# Fails on any difference from the committed generated code, including new
# or deleted files.
# or deleted files. A failing git status is itself a failure: its empty
# output would otherwise read as "no drift".
sqlc-check: sqlc
@drift="$$(git status --porcelain --untracked-files=all -- $(SQLC_OUT))"; \
@drift="$$(git status --porcelain --untracked-files=all -- $(SQLC_OUT))" || { echo "git status failed; cannot check internal/db for drift"; exit 1; }; \
if [ -n "$$drift" ]; then echo "internal/db is stale; run make sqlc and commit:"; echo "$$drift"; git diff -- $(SQLC_OUT); exit 1; fi