Skip to content

Fix false unpushed commit warnings for worktree archive#1158

Merged
boudra merged 2 commits into
mainfrom
fix/worktree-archive-unpushed-commits
May 24, 2026
Merged

Fix false unpushed commit warnings for worktree archive#1158
boudra merged 2 commits into
mainfrom
fix/worktree-archive-unpushed-commits

Conversation

@boudra
Copy link
Copy Markdown
Collaborator

@boudra boudra commented May 24, 2026

Linked issue

None.

Type of change

  • Bug fix
  • New feature (with prior issue + design alignment)
  • Refactor / code improvement
  • Docs

What does this PR do

Fresh Paseo worktrees no longer show every commit in the repository history as "unpushed commits" when the user opens the archive warning.

The status check still preserves the original local-only branch behavior: when a branch has commits ahead of its base but no remote branch yet, those commits count as unpushed. The fix is that the fallback now compares against the known base ref instead of counting the entire branch history.

How did you verify it

Reproduced the bug with a red regression test for a fresh no-track Paseo worktree: before the fix it reported the full branch history as ahead even though it had no commits ahead of base.

Added coverage for both sides of the behavior:

  • a fresh no-track worktree at its base reports aheadOfOrigin: 0
  • a local-only worktree with one commit ahead of base reports aheadOfOrigin: 1
  • the existing deleted-upstream case still reports aheadOfOrigin: null

Verified with:

  • npx vitest run packages/server/src/utils/checkout-git.test.ts --bail=1
  • npm run format:files -- packages/server/src/utils/checkout-git.ts packages/server/src/utils/checkout-git.test.ts
  • npm run lint -- packages/server/src/utils/checkout-git.ts packages/server/src/utils/checkout-git.test.ts
  • npm run typecheck
  • npm run format

The commit hook also reran targeted lint, format check, and typecheck successfully.

Checklist

  • One focused change. Unrelated cleanups split out.
  • npm run typecheck passes
  • npm run lint passes
  • npm run format ran (Biome)
  • UI changes include screenshots or video for every affected platform (N/A: no UI changes)
  • Tests added or updated where it made sense

@boudra boudra merged commit 79dcbdc into main May 24, 2026
14 checks passed
@boudra boudra deleted the fix/worktree-archive-unpushed-commits branch May 24, 2026 04:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant