Artifact 1f728da75068198f77ae09db31597be937720f1259aeee98a1f2d13baf87ad48:
- File
cli/repo_status.go
— part of check-in
[ea23bc8a41]
at
2026-10-21 16:41:13
on branch feat/submanifest-reader
— fix(cli): repo status reports the checkout's changes
Run from inside a checkout with the default --dir ".", repo status reported every tracked file MISSING: filepath.WalkDir's root entry is named ".", and the hidden-directory rule skipped it, and with it the whole tree. The command also compared the disk with tip rather than the checked-out version, so a checkout of an older version read as edited.
The command now opens the checkout and prints Checkout.Status, which classifies changes against the checkout's version as fossil's changes command does, cone included, with fossil's labels. Untracked files are no longer listed; fossil status leaves those to fossil extras. (user: [email protected], size: 964) [annotate] [blame] [check-ins using] [more...]
package cli import ( "fmt" "strings" ) // RepoStatusCmd shows the checkout's changes against its checked-out version. type RepoStatusCmd struct { Dir string `short:"d" help:"Checkout directory to scan" default:"."` } // statusLabels are fossil's changes-command labels for the library's change // kinds; a sparse checkout reports only within its cone, as Status does. var statusLabels = map[string]string{ "modified": "EDITED", "added": "ADDED", "deleted": "DELETED", "missing": "MISSING", "renamed": "RENAMED", } func (c *RepoStatusCmd) Run(g *Globals) error { _, co, done, err := openWorkingCheckout(g, c.Dir) if err != nil { return err } changes, err := co.Status() if closeErr := done(); err == nil { err = closeErr } if err != nil { return err } for _, ch := range changes { label, ok := statusLabels[ch.Change] if !ok { label = strings.ToUpper(ch.Change) } fmt.Printf("%-8s %s\n", label, ch.Name) } return nil }