Skip to content

test: drop Git env vars during unit tests - #216

Merged
dwilding merged 1 commit into
mainfrom
unit-test-env
Oct 31, 2026
Merged

dwilding merged 1 commit into
mainfrom
unit-test-env

Conversation

@dwilding

Copy link
Copy Markdown
Owner

This PR fixes a bug with the unit tests when run by pre-commit after a git commit -am ... command.

`git commit` runs pre-commit hooks with GIT_INDEX_FILE (and friends)
exported, pointing at the parent repository's index. That leaks into
the nested git subprocesses of tests/unit, whose fresh repositories
lack the referenced objects, so their commits die with "Error building
trees" and just-unit fails.

Scrub the four GIT_* path variables via an autouse fixture so every unit
test's Git subprocesses work on their own repositories.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@dwilding
dwilding merged commit 6907650 into main Oct 31, 2026
14 checks passed
@dwilding
dwilding deleted the unit-test-env branch October 31, 2026 05:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant