Problem
When main_branch is configured to a branch other than the remote's default (e.g., a dev/latest branch that tracks curated stable points on main), the dashboard shows spurious diffs on the main worktree.
Root Cause
get_git_status in src/git/status.rs doesn't use the configured main_branch. Instead, it auto-detects the base via get_default_branch_in, which checks refs/remotes/origin/HEAD and falls back to local main/master:
let base_branch = get_branch_base_in(&branch, Some(worktree_path))
.ok()
.or_else(|| get_default_branch_in(Some(worktree_path)).ok())
.unwrap_or_else(|| "main".to_string());
This means: if you're on dev/latest and origin/HEAD points to master, the dashboard treats the main worktree as a feature branch and diffs master...HEAD.
The same issue applies in load_diff (src/command/dashboard/diff_ops.rs), where the fallback is also hardcoded to "main".
Expected Behavior
The configured main_branch should be used as the base for diff and status calculations, with auto-detection only as a fallback when no config is set.
Workaround
git symbolic-ref refs/remotes/origin/HEAD refs/remotes/origin/dev/latest
Problem
When
main_branchis configured to a branch other than the remote's default (e.g., adev/latestbranch that tracks curated stable points onmain), the dashboard shows spurious diffs on the main worktree.Root Cause
get_git_statusinsrc/git/status.rsdoesn't use the configuredmain_branch. Instead, it auto-detects the base viaget_default_branch_in, which checksrefs/remotes/origin/HEADand falls back to localmain/master:This means: if you're on
dev/latestandorigin/HEADpoints tomaster, the dashboard treats the main worktree as a feature branch and diffsmaster...HEAD.The same issue applies in
load_diff(src/command/dashboard/diff_ops.rs), where the fallback is also hardcoded to"main".Expected Behavior
The configured
main_branchshould be used as the base for diff and status calculations, with auto-detection only as a fallback when no config is set.Workaround