Commit 99368b0
authored
fix: use origin/ ref when branching from default branch (#149)
resolve_default_branch returns a bare branch name (e.g. "main") which
points to the local branch. After git fetch, origin/main is up to date
but the local main may be stale — causing new worktrees to start from
an old commit.
The resolved_ref logic in create_worktree compounds this: it tries
git rev-parse "main^{commit}" first, which succeeds with the stale
local SHA, so the origin/ fallback never runs.
Prefix with origin/ so new branches always start from the latest remote.1 parent 4a4e21b commit 99368b0
1 file changed
+2
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
73 | 73 | | |
74 | 74 | | |
75 | 75 | | |
76 | | - | |
| 76 | + | |
77 | 77 | | |
78 | 78 | | |
79 | 79 | | |
80 | 80 | | |
81 | | - | |
| 81 | + | |
82 | 82 | | |
83 | 83 | | |
84 | 84 | | |
| |||
0 commit comments