Add test for detached HEAD discovery, run unit tests for gix-discover and add archives - #3038
Open
Christoph Rüßler (cruessler) wants to merge 1 commit into
Open
Christoph Rüßler (cruessler) wants to merge 1 commit into
Christoph Rüßler (cruessler) wants to merge 1 commit into
Conversation
This commit is the result of a search by GPT 5.4/6.0 (I don’t remember which one) for places where calling `Default::default()` for `gix_hash::Kind` could result in subtle errors. The code was already working as expected, so this commit only adds the appropriate regression test. More specifically, this commit adds a test for the assertion in the comment to [is_git]. In this line, we create a `gix_hash::Kind` via `Default::default`. The test makes sure discovery works for both SHA-1 as well as SHA-256 detached HEADs. [is_git]: https://github.com/cruessler/gitoxide/blob/8f1280faf8dcabcfd967ee004a466f8b473b9b4f/gix-discover/src/is.rs#L72 This commit also adds generated SHA-256 archives for `gix-discover`. It also adds `gix-discover` to the `unit-tests` section of `justfile`. Assisted-by: GPT 6.0
Christoph Rüßler (cruessler)
force-pushed
the
run-gix-discover-tests
branch
from
October 2, 2026 18:36
65b066e to
ef602bb
Compare
Christoph Rüßler (cruessler)
marked this pull request as ready for review
October 2, 2026 19:45
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.
This PR is the result of a search by GPT 5.5/6.0 (I don’t remember which one) for places where calling
Default::default()forgix_hash::Kindcould result in subtle errors. The code was already working as expected, so this commit only adds the appropriate regression test.More specifically, this PR adds a test for the assertion in the comment to is_git. In this line, we create a
gix_hash::KindviaDefault::default(). The test makes sure discovery works for both SHA-1 as well as SHA-256 detached HEADs.This PR also adds generated SHA-256 archives for
gix-discover. It also addsgix-discoverto theunit-testssection ofjustfile.Sebastian Thiel (@Byron) If there’s a specific reason
gix-discovertests are not run underunit-tests, feel free to remove this part. Also, the added test is quite pedantic, but the fact that this is what the LLM finds when asked for potential issues related to assuming SHA-1 as the default make me more confident thatgixmost likely does not have larger issues left. Whatever the case, I’ll try and keep polishing this area as best as I can. 😉