Repository navigation
config: preserve symlink paths for conditional includes - #7449
Open
trestoncuzzort wants to merge 1 commit into
Open
trestoncuzzort wants to merge 1 commit into
trestoncuzzort wants to merge 1 commit into
Conversation
Repository discovery resolves symlinks before evaluating includeIf.gitdir. This loses the path used to open a repository, so a configuration section matching that path is ignored even though Git applies it. Retain an equivalent unresolved gitdir for conditional matching. Relative opens may use PWD only when it identifies the current directory. Validate paths after discovery so traversal above a symlink cannot select another directory. Keep public repository paths and resolved gitfile targets as before. Add coverage for symlink paths, logical and stale PWD, canonical-path controls, bare opens, directory discovery and gitfiles. Fixes libgit2#7255.
trestoncuzzort
marked this pull request as ready for review
October 27, 2026 01:05
This branch has not been deployed
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.
Fixes #7255.
Preserve the equivalent path used to open a repository alongside its canonical path for
includeIf.gitdirmatching. Relative opens usePWDonly when it resolves to the actual current directory. Gitfiles retain their resolved target, matching Git.Validation on the exact base and submitted revisions:
PWDregressions fail before the fix; all 13 conditional-include tests pass afterward. The 96 Git 2.56 comparisons and two gitfile controls match. Config, repository, worktree and submodule suites pass 479 tests under ASan/UBSan, with six skips.core::structinit::comparepadding failure on both revisions, at byte 12 ofgit_diff_options. The util suite passes.path::core::validate_current_user_ownershipassertion.Online tests were not run. Implemented and tested with Codex assistance.