Fetch only on request, remove --no-fetch

Nothing is fetched on startup any more; the header and detail pane show
the last fetch and f fetches everything. Records the change as D22.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-22 12:13:01 +02:00
co-authored by Claude Sonnet 5.5
parent 928e76154f
commit a285a35c95
8 changed files with 36 additions and 32 deletions
+1 -11
View File
@@ -29,17 +29,11 @@ const (
detailWidthRatio = 0.4
)
// Options configure the application.
type Options struct {
Fetch bool // fetch all repositories in the background on startup
}
type Model struct {
ctx context.Context
provider submodule.Provider
fetcher submodule.Fetcher // nil if the provider can't fetch
watcher submodule.Watcher // nil if the provider can't watch
opts Options
theme theme.Theme
keys keyMap
@@ -66,7 +60,7 @@ type Model struct {
showDetail bool
}
func New(ctx context.Context, p submodule.Provider, opts Options) Model {
func New(ctx context.Context, p submodule.Provider) Model {
t := theme.Default()
k := defaultKeys()
sp := spinner.New(spinner.WithSpinner(spinner.MiniDot))
@@ -79,7 +73,6 @@ func New(ctx context.Context, p submodule.Provider, opts Options) Model {
m := Model{
ctx: ctx,
provider: p,
opts: opts,
theme: t,
keys: k,
loads: newReloader(),
@@ -289,9 +282,6 @@ func (m Model) treeLoaded(msg treeLoadedMsg) (tea.Model, tea.Cmd) {
m.changes = m.watcher.Watch(m.ctx)
cmds = append(cmds, m.waitForChange())
}
if m.opts.Fetch {
cmds = append(cmds, m.startFetch())
}
} else {
m.tree.ReplaceRoots(m.repo.Submodules)
}