From cebf8b4d79448a967b01a30e46d6c5eb081514df Mon Sep 17 00:00:00 2001 From: dev_agent Date: Sun, 11 Oct 2026 00:06:52 -0400 Subject: [PATCH] Fail sqlc-check when git status itself fails An erroring git status printed nothing, which the drift check read as a clean tree and passed. Co-Authored-By: Claude Opus 5.5 --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 4356184..027386b 100644 --- a/Makefile +++ b/Makefile @@ -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