Archived
Make the superproject selectable via the header
The header stands for the root repository: it is selected on startup, shows the root's own state word, and the detail pane shows its state like a submodule's (HEAD vs. upstream, changes, unpushed, leftover submodule clones as untracked repositories). Submodules are ignored in the root's changes; their rows show them. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -16,6 +16,7 @@ type Repo struct {
|
||||
Ahead int
|
||||
Behind int
|
||||
FetchedAt time.Time
|
||||
Root *Submodule // the superproject as a selectable node; Path is "", no Children
|
||||
Submodules []*Submodule
|
||||
}
|
||||
|
||||
@@ -32,6 +33,9 @@ type Submodule struct {
|
||||
FetchErr error // set if the last fetch failed; not an issue
|
||||
}
|
||||
|
||||
// IsRoot reports whether s is the superproject itself.
|
||||
func (s *Submodule) IsRoot() bool { return s != nil && s.Path == "" }
|
||||
|
||||
// Presence describes whether the submodule exists on disk.
|
||||
type Presence int
|
||||
|
||||
@@ -171,6 +175,7 @@ func (c *Changes) Sort() {
|
||||
|
||||
// Status is the full state of one submodule.
|
||||
type Status struct {
|
||||
Root bool // the superproject: the "pin" is its HEAD
|
||||
Presence Presence
|
||||
Checkout Checkout
|
||||
Worktree Worktree
|
||||
|
||||
Reference in New Issue
Block a user