fix(kustomize-validate): scrub hook GIT_DIR so worktree pushes validate#20
Merged
Conversation
Git hooks export an absolute GIT_DIR (always for worktrees) that leaks into kustomize's nested git when it clones remote resources — its `git remote add origin` targets the OUTER repo and dies with "remote origin already exists". Repro: pre-push from any git worktree of cshuttle/main failed on the intel-gpu-plugin overlays (the only remote git bases); the same tree validated clean when run standalone and in CI. unset the hook env at script top; verified the exact repro now builds 2/2 under a hook-style GIT_DIR. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.
Git hooks export an absolute
GIT_DIR(always, for worktrees) that leaks into kustomize's nested git during remote-resource clones —git remote add originhits the outer repo: "remote origin already exists". Every pre-push from a git worktree of a GitOps repo failed on remote-git-base overlays while the identical tree passed standalone and in CI.Fix: unset
GIT_DIR GIT_WORK_TREE GIT_INDEX_FILE GIT_COMMON_DIR GIT_PREFIXat script top. Verified: the reproduction (hook-style GIT_DIR from a cshuttle/main worktree, intel-gpu-plugin overlays) fails on the old script and builds 2/2 on this one. shellcheck clean.🤖 Generated with Claude Code