mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-11 08:06:25 -04:00
When a branch's fork point is reachable from more than one configured main branch and the candidates disagree on the behind count, the branches column was silently showing the config-order first candidate's number — confidently asserting something we don't actually know. Worse, "nothing" in the column means "up to date with the base", which may or may not be true under ambiguity. Compute behind values for every candidate (the fast path already had them; the legacy path now does too via baseBranchCandidatesAndBehinds), then classify: - all candidates agree → show that number (or nothing if 0) - some candidates 0, others not → "?" (we can't say if up to date) - all non-zero but differing → "↓?" (definitely behind, unknown amount) Two sentinel constants on the Branch model (BehindBaseAmbiguousMaybeUpToDate and BehindBaseAmbiguousDefinitelyBehind) encode these states in the existing atomic.Int32 field via negative values; the renderer switches on them. |
||
|---|---|---|
| .. | ||
| authors | ||
| graph | ||
| icons | ||
| branches.go | ||
| branches_test.go | ||
| commits.go | ||
| commits_test.go | ||
| files.go | ||
| files_test.go | ||
| item_operations.go | ||
| loader.go | ||
| reflog_commits.go | ||
| remote_branches.go | ||
| remotes.go | ||
| stash_entries.go | ||
| status.go | ||
| submodules.go | ||
| suggestions.go | ||
| tags.go | ||
| worktrees.go | ||
| worktrees_test.go | ||