Add list command to display all tracked entries

Adds Garden.List() method that returns manifest entries, unit tests
for empty and populated repos, and a CLI command that formats output
by entry type (file with hash prefix, link with target, directory).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-23 21:51:01 -07:00
parent 0d53ca34aa
commit 34f9598a19
3 changed files with 116 additions and 0 deletions

8
garden/list.go Normal file
View File

@@ -0,0 +1,8 @@
package garden
import "github.com/kisom/sgard/manifest"
// List returns all tracked entries from the manifest.
func (g *Garden) List() []manifest.Entry {
return g.manifest.Files
}