You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 9d74656
Browse filesBrowse the repository at this point in the historyBrowse files
fix(submodule): bind writes to the validated checkout
The requested audit against Git's submodule path validation found that
`Submodule.module()` checked the checkout path, then let `Repo` select a
different working tree from `core.worktree`. A symlink in that configured
path could redirect `update()` writes outside the checkout. Unforced
`remove(configuration=False)` could delete the external working tree.
Pass the checked checkout as `GIT_WORK_TREE` when opening the shared module
handle. This keeps updates, removal and recursive traversal on the validated
path without making repository queries rewrite configuration. Existing Git
metadata symlinks remain supported.
Git reference `6de20f6092dcf9bdb1c8efe03db4b70c82b423dd` validates checkout
components in `submodule.c:validate_submodule_path()` and repairs configured
worktrees before update in `builtin/submodule--helper.c:ensure_core_worktree()`.
Git 2.54.0 preserves external targets in the new update/deinit comparisons.
GitPython previously overwrote or deleted them. The regressions cover leaf
and intermediate symlinks, and pass on both CLI and Gix backends after the fix.
Record the independently observed GixPython 0.3.0 configured-worktree
canonicalization difference under the still-open `GIX-14` ledger entry.
The scoped submodule guard does not claim to fix native discovery upstream.
Validation: eight focused regression cases per backend; full `mypy` and
`basedpyright --warnings`; Ruff check/format; ShellCheck with sourced fixtures;
`git diff --check`.
Agent-Model: unknown
Copy file name to clipboardExpand all lines: doc/gix-backend.md
+12Lines changed: 12 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -968,6 +968,18 @@ identify the historical fixture where needed.
968
968
| GIX-33 | Bug (open); missing exact-name mode | With Git 2.54.0 and GixPython 0.3.0, `exact-refs.sh sha1 files symbolic` makes `refs/tags/REBASE_HEAD` a symbolic ref to another tag while the root `REBASE_HEAD` is absent. `Repository.try_find_reference("REBASE_HEAD")` returns that tag; native `_symbolic_ref` formerly returned its target, whereas `git symbolic-ref --quiet --no-recurse -- REBASE_HEAD` exits 1. GitPython's root-reference object read consequently returned a commit through Gix and raised `ValueError` through CLI. SHA-256 reproduces the same mismatch. | Expose an exact-name lookup mode, including root references, whose absence and error behavior matches Git. `_symbolic_ref()` compares the native reference's name with the requested bytes and selects CLI for a lookalike. `test_missing_root_reference_does_not_follow_symbolic_lookalike_tag` verifies parity and forced CLI fallback. This adapter guard does not close the upstream compatibility bug. |
969
969
| GIX-34 | Bug (open) | With Git 2.54.0 and GixPython 0.3.0, an author, committer or tagger line with fields after its time zone, such as `A <a@example.com> 1112591163 +0200 1700000000 -0500`, decodes through `Commit.author()`/`committer()` and `Tag.tagger()` with the correct seconds but an offset of 0. Git reads only the first date and time zone after the last `>` (`split_ident_line`) and reports `1112591163 +0200` through `git show --format=%ad --date=raw` and `%(taggerdate:raw)`. `git fsck` reports `badTimezone` for such objects, but the default `transfer.fsckObjects=false` accepts them. The `trailing-date` read-only `commit.sh` fixture in `test_deserialization_reads_date_after_email` reproduces both object kinds. | Report the time zone Git reads for identity lines with trailing fields, or reject them consistently. `object_metadata()` selects CLI when the decoded signature does not reproduce the end of its raw header line. This adapter guard does not close the upstream compatibility bug. |
970
970
971
+
GIX-14 also covers configured worktree symlink resolution. On macOS with
972
+
GixPython 0.3.0, CPython 3.12.14 and Git 2.54.0, set a submodule's
973
+
`core.worktree` to `parent/redirect`, where `redirect` links to `outside`.
0 commit comments