Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
๐ข Approval recommended
No active review issues are reported for this test-only change to make Git reference-path coverage platform-independent.
No open issues ๐
What changed in this PR
This test-only change fixes Windows failures in PathLike revision-argument coverage without changing production reference validation.
Changes:
- Use
PurePosixPathfor Git reference names so separators remain forward slashes on every platform. - Preserve
PathLikeMockcoverage and retain nativePathfor filesystem operations.
Reviewed by GitHub Copilot.
| File | Description |
|---|---|
test/โtest_refs.py |
Import PurePosixPath and use it in the revision-argument test parameterization. |
Review effort: Balanced
Contributor
There was a problem hiding this comment.
๐ก Changes recommended
Benchmark fingerprints omit harness changes, allowing misleading workload comparisons, while throughput calculations use iteration limits rather than actual processed counts, inflating reported rates.
2 open issues
Review effort: Balanced
<!-- agent -->
Restore Windows CI coverage for `PathLike` revision arguments. The test
introduced in `6de90f1c` uses `Path("refs/heads/main")`, which emits
backslashes on Windows. Those are invalid Git reference names, so resolving
`SymbolicReference` fails during ref-name validation in all four
files/reftable and SHA-1/SHA-256 variants. The same failures were already
present in PR #2336, before the unrelated `patch_env()` change in PR #2340.
Use `PurePosixPath` for the test's Git reference names, which use forward
slashes on every platform. It still implements `os.PathLike`, preserving
coverage through `SymbolicReference` and direct and nested `merge_base()`
arguments alongside `PathLikeMock`. Keep native `Path` for filesystem
operations elsewhere in the module and preserve production validation.
Assisted-by: GPT 6.1 Sol
Co-authored-by: GPT 6.1 Sol <codex@openai.com>
Took a quick look, pretty zoomed out, but think it's a desirable change as finally the test-suite is independent of the input repository or state. <!-- agent --> Make PR and post-merge test results independent of checkout depth, refs, and history. The shared test repository and dependency clone sources previously came from the source checkout, requiring historical objects and a bootstrap script even though setup already used `gix.testtools`. Generate small repositories from scratch through `gix.testtools`, with named root, release, merge, conflict, rename, date, and submodule states. Adapt legacy assertions to those scenarios while retaining merge, serialization, traversal, index, remote, and nested-submodule coverage. Make dirty-submodule removal checks explicit for staged, unstaged, and untracked data, including dry runs. Remove the source-history environment override, dependency factory, checkout lock cleanup, and bootstrap script. The main CI suites now use shallow checkouts and remove source `.git` metadata before pytest. Add a regression that initializes the shared fixture from a source copy without Git metadata, and document the isolation requirement. Hash raw parser samples in cache arguments to avoid archive filename limits on cold runs. Assisted-by: GPT 6.0 Astra Co-authored-by: GPT 6.0 Astra <codex@openai.com>
<!-- agent --> GitDB tests previously opened the source checkout's `.git` directory or `GITDB_TEST_GIT_REPO_BASE`, making their input depend on clone history. Give each test class a disposable repository generated by a fixture script, with packed history and additional loose objects. Isolate Git configuration and identity during setup and register class cleanup. Run the script with Bash so the standalone suite retains Python 3.8 support without adding a GixPython dependency. Remove the history override and full-depth checkout from dependency CI, remove source `.git` before running the suite, and document the new setup. Use the actual database size when writing a pack instead of the unrelated iteration count, which the smaller fixture exposed. Assisted-by: GPT 6.0 Astra Co-authored-by: GPT 6.0 Astra <codex@openai.com>
โฆcounts <!-- agent --> Address benchmark review feedback on the generated fixtures. Copilot noted that "performance tests still report their iteration limits of 1,000โ10,000 as processed counts" even though the fixture has only 90 packed objects. Use the existing streaming counters and clamp list-based limits to the available SHA count so both totals and throughput reflect completed work. Copilot also requested: "Include the benchmark harness sources in the fingerprint, and add a harness-only change to the digest regression test." Hash the Python sources in `test/performance` alongside `VERSION` and `git`. This prevents comparing different timed workloads that return the same result. Extend the generated source fixture and document the digest scope. Assisted-by: GPT 6.0 Astra Co-authored-by: GPT 6.0 Astra <codex@openai.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.

Tasks
Created by Codex on behalf of Byron. Byron will review before this is ready to merge.
GitPython's Windows CI exposed invalid reference paths in a
PathLiketest,while its test fixtures depended on the source checkout's history and refs.
This work makes PR, post-merge, and source-archive test runs exercise the same
inputs, and restores portable reference-argument coverage.
and benchmark repositories from fixture scripts. Preserve the existing test
scenarios through named revisions, remove the history bootstrap, and run CI
after removing source Git metadata.
PurePosixPathfor Git reference names so Windows keeps forward slasheswhile retaining
PathLikecoverage and production reference validation.Git metadata. Report actual processed-object counts in GitDB benchmark rates.
The benchmark workload is now generated, so old history-based timings are not
comparable. Local validation for the review fixes: seven comparison tests and
five GitDB performance tests pass; an output check verifies totals and rates
against the 90-object fixture. The harness-only regression failed before the
fix. Ruff lint and formatting checks pass. CI is running on the updated head.