libexpr: Clear GIT_DIR/GIT_WORK_TREE/GIT_COMMON_DIR env vars when doing git status for dirty zone detection#23
Merged
lilyinstarlight merged 1 commit intotecnix-gcsfrom Apr 30, 2026
Conversation
…ng `git status` for dirty zone detection
95279e9 to
ab8b051
Compare
joshheinrichs-shopify
approved these changes
Apr 30, 2026
Contributor
joshheinrichs-shopify
left a comment
There was a problem hiding this comment.
good call i think this catches the most common cases. if this pops up for other env vars in the future maybe we should purge all GIT_* env vars, or go even more extreme and blank out everything except explicitly permitted environment variables.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
These can affect git's repository discovery and cause issues (e.g. in the middle of a
git bisect runwhich apparently sets these env vars) when tecnix is expectinggit statusto do normal repository discovery via the checkout path supplied to-C(we don't have the worktree git dir information in tecnix to supply to--git-dirwhich would probably otherwise have been better to work around this issue)