Don't count failed loads as loading; explain missing gitlink

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-21 20:09:59 +02:00
co-authored by Claude Sonnet 5.5
parent 633de5aab1
commit 69d0f9b704
3 changed files with 7 additions and 3 deletions
+3 -1
View File
@@ -121,7 +121,9 @@ Changes 5 files · 2M 1A 1D 1R · +37 −12
`path branch ↑↓ · n submodules · <count> <issue>… · n pin staged · n loading · <fetch>` `path branch ↑↓ · n submodules · <count> <issue>… · n pin staged · n loading · <fetch>`
Issue counts are ordered by severity (unpushed, conflict, missing, off pin, Issue counts are ordered by severity (unpushed, conflict, missing, off pin,
changed), each in its level color. Zero counts are omitted. A detached changed), each in its level color. Zero counts are omitted. `n loading`
counts only submodules whose status is still being loaded; ones whose load
failed (shown as `error`) are not counted. A detached
superproject shows `(detached)` as its branch. superproject shows `(detached)` as its branch.
`<fetch>` on the right: `<fetch>` on the right:
+1 -1
View File
@@ -158,7 +158,7 @@ func status(ctx context.Context, in info) (*submodule.Status, error) {
} }
pin := parseGitlink(out) pin := parseGitlink(out)
if pin == "" { if pin == "" {
return nil, errors.New("no gitlink in the superproject index") return nil, errors.New("listed in .gitmodules, but has no gitlink in the superproject index (stale entry?)")
} }
out, _, err = try(ctx, in.superDir, "ls-tree", "HEAD", "--", in.relPath) out, _, err = try(ctx, in.superDir, "ls-tree", "HEAD", "--", in.relPath)
if err != nil { if err != nil {
+3 -1
View File
@@ -42,7 +42,9 @@ func View(t theme.Theme, repo *submodule.Repo, fetch Fetch, spinner string, widt
submodule.Walk(repo.Submodules, func(s *submodule.Submodule) { submodule.Walk(repo.Submodules, func(s *submodule.Submodule) {
total++ total++
if s.Status == nil { if s.Status == nil {
loading++ if s.Err == nil {
loading++
}
return return
} }
if s.Status.PinStaged { if s.Status.PinStaged {