feat: resolve diverged worktrees, status --plan, snapshot size limit

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
dasemuandClaude Sonnet 5.5 committed 2026-11-16 13:25:22 +01:00
1 parent b86342b1d0
commit 398b959ffe
13 files changed
+443 -17

No files matched your search

+12
View File
@@ -67,6 +67,18 @@ pub fn clone_bare_layout(
f = f.with_env(k, v);
}
f.run(&["fetch", "-q", "--prune", "origin"])?;
// `clone --bare` creates local branches without upstream config; worktrees made from them
// would then never be classified as ahead/behind.
let b = Git::new(&bare);
let heads = b.run(&["for-each-ref", "--format=%(refname:short)", "refs/heads"])?;
for br in heads.lines() {
let up = format!("origin/{br}");
if b.probe(&["rev-parse", "-q", "--verify", &format!("refs/remotes/{up}")])?
.is_some()
{
b.run(&["branch", "-q", &format!("--set-upstream-to={up}"), br])?;
}
}
materialize(dir, "origin")
}