← Winnitude! Search  ·  Reader Mode (2003 ms)
Links: Stay in Reader Retro Site Converter Retro Mode: OFF Original Page ↗
GITHUB · 1 LINKS

Fix repository discovery precedence by Byron · Pull Request #2218 · gitpython-developers/GitPython

Tasks This section is for Byron only. Models continuing this PR must not add, remove, check, uncheck, rename, or reorder checkboxes here. refackiew Everything below this line was generated by Codex GPT-5. Created by Codex on behalf of Byron. Byron will review before this is ready to merge. Advisory GHSA-239g-whfq-7xj9 GHSA-239g-whfq-7xj9 reports that repository content can be mistaken for repository metadata when GitPython opens a normal worktree. Advisory summary Severity: high Package: GitPython (pip) Affected versions: <= 3.1.59 Patched versions: not yet assigned CVE: not yet assigned Changes Follow Git discovery precedence by resolving .git before considering the current directory as a bare repository. Validate HEAD and commondir-backed object/reference storage when identifying a git directory. Reject malformed .git metadata instead of falling through to another candidate. Parse Gitfiles with Git's regular-file, size, and single-target rules. Preserve resolved GIT_DIR and GIT_COMMON_DIR values through repository construction and later Git commands. Add the advisory URL to the upcoming 3.1.60 changelog. Git baseline: 15c6308cf7ad276b306aa5b3ababfbdebfb1a917, especially setup.c setup_git_directory_gently_1(), is_git_directory(), validate_headref(), read_gitfile_gently(), and get_common_dir_noenv(). Validation 8 focused tests passed, plus 12 subtests. Ruff check and format passed. mypy passed for the changed modules. compileall and git diff --check passed. The attached PoC scripts were inspected as text and were not executed. Commits 1424148 fix: prefer .git during repository discovery e003731 fix: retain GIT_COMMON_DIR during discovery f2d1c4c fix: initialize common directory before config 32baeab Address review feedback about repository discovery b8c000e Address review feedback about Gitfile handling 83c3e64 Address review feedback about dangling commondir

Skip to content

Repository navigation