Add restore (x): make a repository exactly what git records

Restores the selection and all submodules below it recursively, asking
only if work would be lost. May clone/fetch missing objects (D23).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 12:38:29 +02:00
co-authored by Claude Opus 5.5
parent a328d3cc3a
commit 7980d3356a
16 changed files with 1260 additions and 118 deletions
+7
View File
@@ -64,6 +64,13 @@ type Watcher interface {
}
```
```go
type Restorer interface {
RestoreLoss(ctx context.Context, path string) (Loss, error) // what a restore would discard
Restore(ctx context.Context, path string) error // may clone/fetch what is missing
}
```
```go
type Locator interface {
Dir(path string) string // absolute directory, "" if unknown