Artifact 754c15db6a0c42a0d18c1f67a9239eb46d857861a5010ee4d91d4bc5eca11991:
- File
cli/repo_verify.go
— part of check-in
[168062ca33]
at
2026-10-21 16:43:34
on branch feat/submanifest-reader
— fix(cli): repo verify reports damage, transit phantoms and elision
repo verify hashed the held blobs and printed a fixed line. It now runs the full verifier the library uses for rebuild, prints each issue, and reports transit phantoms apart from elided artifacts, as sparse-cone 5.2 requires of a verification operation: a store complete within its cone verifies healthy and shows its elided count. (user: [email protected], size: 1082) [annotate] [blame] [check-ins using] [more...]
package cli import ( "fmt" "github.com/danmestas/go-libfossil/internal/verify" ) // RepoVerifyCmd verifies repository integrity: every held artifact against // its name, delta chains, phantom records and the derived tables. It reports // what the store lacks by class (sparse-cone ยง5.2): transit phantoms, which // sync still wants, apart from artifacts the store cone deliberately elides, // which are healthy and never an error. type RepoVerifyCmd struct{} func (c *RepoVerifyCmd) Run(g *Globals) error { r, err := g.OpenRepo() if err != nil { return err } defer r.Close() report, err := verify.Verify(r.Inner()) if err != nil { return fmt.Errorf("verification failed: %w", err) } for _, issue := range report.Issues { fmt.Printf("ERROR %s %s\n", issue.UUID, issue.Message) } fmt.Printf("%d artifacts checked, %d transit phantoms, %d elided\n", report.BlobsChecked, report.Phantoms, report.Elided) if !report.OK() { return fmt.Errorf("verification failed: %d issues", len(report.Issues)) } fmt.Println("repository integrity verified") return nil }