test: add missing noprefix test for hunk show command#117
Merged
benvinegar merged 1 commit intomainfrom Mar 24, 2026
Merged
Conversation
Adds regression test for hunk show with diff.noprefix=true, completing the test coverage for all git-backed commands that use withNormalizedDiffPrefixes().
Greptile SummaryThis PR adds a single integration test that fills the last gap in the
Confidence Score: 5/5
Important Files Changed
Sequence DiagramsequenceDiagram
participant Test as Test (loaders.test.ts)
participant Repo as Temp Git Repo
participant Loader as loadFromRepo / loadAppBootstrap
participant Git as git show
Test->>Repo: git init + initial commit (alpha.ts v1)
Test->>Repo: git config diff.noprefix true
Test->>Repo: commit alpha.ts v2 (HEAD)
Test->>Loader: loadFromRepo({ kind: "show" })
Loader->>Loader: buildGitShowArgs() → withNormalizedDiffPrefixes()<br/>injects -c diff.srcPrefix=a/ -c diff.dstPrefix=b/
Loader->>Git: git -c diff.srcPrefix=a/ -c diff.dstPrefix=b/ show HEAD
Git-->>Loader: diff output (normalized prefixes)
Loader-->>Test: bootstrap.changeset
Test->>Test: assert files = ["alpha.ts"] ✓
Reviews (1): Last reviewed commit: "test: add missing noprefix test for hunk..." | Re-trigger Greptile |
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.
Follow-up to #106 - adds the missing test coverage for `hunk show` with `diff.noprefix=true`.
This completes the test coverage for all git-backed commands that use `withNormalizedDiffPrefixes()`:
All 5 tests pass:
````
bun test test/loaders.test.ts -t "diff.noprefix is enabled|diff.mnemonicPrefix is enabled"
5 pass, 15 filtered out, 0 fail
````