gabriel / muse public
fix main #20 / 100

fix: correct branch resolution in fetch and add --prune/--all/--dry-run

Bug: muse fetch with no explicit --branch used get_upstream() whose return value is the upstream *remote name* (e.g. "origin"), not the branch name. This caused "Branch 'origin' does not exist on remote 'origin'" whenever the remote's branch tracking was set, because "origin" was passed as the branch to look up in the remote's branch_heads map.

Fix: use the current local branch name directly as the default, which is the correct git-equivalent behaviour.

New flags that match git fetch: --all fetch all configured remotes --prune / -p remove stale remote-tracking refs (branches deleted on remote) --dry-run / -n show what would be fetched without writing anything --tags / --no-tags reserved for future tag storage (parsed, no-op for now)

When a branch is not found on the remote, the error now lists all available branch names so the user knows what to pass with --branch.

Adds regression test for the upstream-name-as-branch bug, plus tests for --prune, --dry-run, --all, up-to-date fast-path, and branch hint output.

G Gabriel Cardona <gabriel@tellurstori.com> · 21h ago Mar 23, 2026 · b5d8116d · parent 9d49af7a
2
files changed
414
files in snapshot
Files Changed 414 in snapshot
~2

0 comments

No comments yet. Be the first to start the discussion.