Skip to content

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
clear-git-dir-env-vars-for-dirty-detection-git-status
Apr 30, 2026
Merged

libexpr: Clear GIT_DIR/GIT_WORK_TREE/GIT_COMMON_DIR env vars when doing git status for dirty zone detection#23
lilyinstarlight merged 1 commit intotecnix-gcsfrom
clear-git-dir-env-vars-for-dirty-detection-git-status

Conversation

@lilyinstarlight
Copy link
Copy Markdown
Contributor

These can affect git's repository discovery and cause issues (e.g. in the middle of a git bisect run which apparently sets these env vars) when tecnix is expecting git status to 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-dir which would probably otherwise have been better to work around this issue)

@lilyinstarlight lilyinstarlight force-pushed the clear-git-dir-env-vars-for-dirty-detection-git-status branch from 95279e9 to ab8b051 Compare April 30, 2026 16:12
Copy link
Copy Markdown
Contributor

@joshheinrichs-shopify joshheinrichs-shopify left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@lilyinstarlight lilyinstarlight merged commit 699aa20 into tecnix-gcs Apr 30, 2026
10 checks passed
@lilyinstarlight lilyinstarlight deleted the clear-git-dir-env-vars-for-dirty-detection-git-status branch April 30, 2026 17:04
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.

2 participants