diet-guard/scripts
Krzysztof kuhy Rudnicki 94081233f2
Some checks are pending
pre-commit / pre-commit (push) Waiting to run
Tests / test (3.10) (push) Waiting to run
Tests / test (3.11) (push) Waiting to run
Tests / test (3.12) (push) Waiting to run
ci_mirror: run flutter with the git hook's environment stripped
The pre-push gate failed on `flutter analyze` with "The current Flutter SDK
version is 0.0.0-unknown", while the same command passed when run by hand.

`git push` exports GIT_DIR to its hooks, and the flutter tool shells out to
git to identify its own SDK. With GIT_DIR set it reads THIS repository
instead of /opt/flutter -- `flutter --version` inside the hook reports

    Flutter 3.47.0-0.1.pre • channel main • https://github.com/kuhyx/diet-guard
    Framework • revision 84bd5503 (our own HEAD)

so pub cannot resolve any SDK constraint and every dependency is "forbidden".
Worse, flutter writes that answer into its own version cache, so the next
caller -- in any repo -- inherits it until something repairs it.

Wrapping the two flutter calls in `env -u GIT_DIR ...` fixes it at the point
of use. Not `--no-verify`: the gate was right that something was wrong, it
just was not the code being pushed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-07-26 15:26:54 +02:00
..
check_file_length.py Extract diet_guard from testsAndMisc as a standalone repo 2026-06-22 12:18:39 +02:00
check_requirements_sync.py Add CI-mirror pre-push gate + requirements-sync check 2026-07-11 17:58:49 +02:00
ci_mirror.sh ci_mirror: run flutter with the git hook's environment stripped 2026-07-26 15:26:54 +02:00
setup_mcp.sh Fix pre-existing CI failures (deps, lint, whitespace) 2026-07-10 23:55:56 +02:00