Add tests for Repository::open_mailmap and open_mailmap_into#2622
Open
Amey Pawar (ameyypawar) wants to merge 1 commit into
Open
Add tests for Repository::open_mailmap and open_mailmap_into#2622Amey Pawar (ameyypawar) wants to merge 1 commit into
Amey Pawar (ameyypawar) wants to merge 1 commit into
Conversation
Covers two of the four mailmap source paths documented on open_mailmap_into: the no-source case (empty snapshot, no error) via the existing make_basic_repo.sh fixture, and the worktree .mailmap case via a new make_mailmap_repo.sh fixture. The remaining sources (mailmap.blob, mailmap.file, bare repo HEAD:.mailmap) are intentionally deferred to a follow-up to keep this change small. Also removes the two // TODO: tests markers in gix/src/repository/mailmap.rs.
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.
What
Adds integration tests for
gix::Repository::open_mailmap()andopen_mailmap_into(), addressing the two// TODO: testsmarkers ingix/src/repository/mailmap.rs.Two cases are covered:
.mailmap, nomailmap.blob, and nomailmap.fileyields an emptySnapshot, andopen_mailmap_intoreturnsOk(()). Reuses the existingmake_basic_repo.shfixture (no new fixture needed)..mailmap— a new minimal fixturemake_mailmap_repo.shchecks that an entry remapping a name by email is loaded from the worktree root and applied viaSnapshot::try_resolve.Out of scope (deliberately)
To keep the PR small, three remaining source paths documented on
open_mailmap_intoare left for a follow-up:mailmap.blob(revspec config)mailmap.file(filesystem-path config, follows symlinks)HEAD:.mailmapwhenmailmap.blobis unsetVerification
cargo test -p gix --test gix repository::mailmap— 2 passedcargo test -p gix --test gix repository— 146 passedGIX_TEST_FIXTURE_HASH=sha256— 146 passedcargo fmt --check+cargo clippy -p gix --tests --no-deps -- -D warnings— cleanmake_mailmap_repo.tar(SHA1) andmake_mailmap_repo_sha256.tar(SHA256) generated and committed undergix/tests/fixtures/generated-archives/, matching repo convention.Disclosure
This PR was drafted with AI assistance (Claude Code) under my review and direction. I designed the scope, reviewed every line, and ran the verification myself before pushing.