feat: detect and reject sha256 object format repositories - #1242
Conversation
go-git v5 cannot read sha256 repositories and fails with a cryptic "core.repositoryformatversion does not support extension: objectformat". gitview.New now wraps that failure in ErrUnsupportedObjectFormat with a message naming sha256.
a8e40f4 to
4cbda6c
Compare
|
Claude finished @mbevc1's task in 1m 49s —— View job Follow-up review — PR #1242
Previous findingsNone found. The PR has exactly one commit, and the only prior activity on this comment was a stuck "working…" placeholder — no substantive review was ever posted and there are zero inline review comments on the PR ( New review of the changed linesWalked through the new code in
No bugs, security issues, or regressions found in the changed lines — 0 new inline comments posted. Note: I was unable to run |
|
|
||
| const redactedCommitInfoValue = "**REDACTED**" | ||
|
|
||
| // TODO: remove this guard once go-git supports sha256 (v6) and the Kosli backend accepts sha256 commits. |
There was a problem hiding this comment.
Non-blocking comment:
Do we track these somehow?
Otherwise, I fear they just become noise over time. 🤔
There was a problem hiding this comment.
Not sure, but I do get it highlighted in my editor and sometimes would grep for those 😅
What does this PR change and why?
This PR adds detection and rejection of Git repositories using the sha256 object format, which is not yet supported by the Kosli CLI. The go-git library and Kosli backend do not currently support sha256 commits, so attempting to open such a repository now returns a clear, actionable error message instead of failing later with a cryptic error.
Links to:
Changes
internal/gitview/gitView.go:ErrUnsupportedObjectFormaterror variable with a user-friendly messageisUnsupportedObjectFormat()helper to detect sha256 object format errors from go-gitNew()to check for unsupported object formats and return a wrapped error with contextinternal/gitview/gitView_test.go:ErrUnsupportedObjectFormatTestNewGitViewSha256Repo()test that creates a sha256 repository and verifies the error is properly detected and reportedChecklist