Commit 0ac8fe4
fix: haiku_repair stale-ref loop and hardcoded mainline branch (#225)
* fix: haiku_repair stale-ref loop and hardcoded mainline branch
Repair was creating worktrees from stale local refs, reapplying fixes
already on the remote, failing to push non-fast-forward, and reporting
the same issues forever. It also blew up on repos where the remote
default branch isn't main/master.
- Fetch origin upfront in repairAllBranches so origin/HEAD and every
temp worktree reflect current remote state
- addTempWorktree gains preferRemote flag; repair call sites use
origin/<branch> so scans see remote truth, not stale local tips
- commitAndPushFromWorktree rebases onto origin/<branch> and retries
once on non-fast-forward; aborts rebase cleanly on conflict
- getMainlineBranch resolves origin/HEAD via git symbolic-ref first,
so repos with dev/trunk/etc. as default work correctly
- haiku_review diff base falls back to getMainlineBranch() instead of
hardcoded "main"
Fixes #206
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* fix: tighten NFF regex and biome format
Review feedback on #225:
- Drop bare "rejected" from non-fast-forward detection so we don't
rebase on protected-branch rejections or hook failures that also
print "rejected"
- Biome format fix for the rebase execFileSync call
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 97a4f92 commit 0ac8fe4
2 files changed
+104
-22
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
41 | 47 | | |
42 | 48 | | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
43 | 59 | | |
44 | 60 | | |
45 | 61 | | |
| |||
49 | 65 | | |
50 | 66 | | |
51 | 67 | | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
52 | 80 | | |
53 | 81 | | |
54 | 82 | | |
| |||
188 | 216 | | |
189 | 217 | | |
190 | 218 | | |
191 | | - | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
192 | 222 | | |
193 | 223 | | |
194 | 224 | | |
| 225 | + | |
195 | 226 | | |
196 | 227 | | |
197 | 228 | | |
198 | 229 | | |
199 | 230 | | |
200 | 231 | | |
201 | | - | |
202 | | - | |
203 | | - | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
204 | 241 | | |
205 | 242 | | |
206 | 243 | | |
| |||
242 | 279 | | |
243 | 280 | | |
244 | 281 | | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
253 | | - | |
254 | | - | |
255 | | - | |
256 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
257 | 326 | | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
258 | 330 | | |
| 331 | + | |
| 332 | + | |
259 | 333 | | |
260 | 334 | | |
261 | 335 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
| 23 | + | |
23 | 24 | | |
24 | 25 | | |
25 | 26 | | |
| |||
1109 | 1110 | | |
1110 | 1111 | | |
1111 | 1112 | | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
1112 | 1119 | | |
1113 | 1120 | | |
1114 | 1121 | | |
| |||
1202 | 1209 | | |
1203 | 1210 | | |
1204 | 1211 | | |
1205 | | - | |
| 1212 | + | |
1206 | 1213 | | |
1207 | 1214 | | |
1208 | 1215 | | |
| |||
1312 | 1319 | | |
1313 | 1320 | | |
1314 | 1321 | | |
1315 | | - | |
| 1322 | + | |
1316 | 1323 | | |
1317 | 1324 | | |
1318 | 1325 | | |
| |||
3193 | 3200 | | |
3194 | 3201 | | |
3195 | 3202 | | |
3196 | | - | |
3197 | | - | |
| 3203 | + | |
| 3204 | + | |
| 3205 | + | |
3198 | 3206 | | |
3199 | 3207 | | |
3200 | 3208 | | |
| |||
3205 | 3213 | | |
3206 | 3214 | | |
3207 | 3215 | | |
3208 | | - | |
| 3216 | + | |
3209 | 3217 | | |
3210 | 3218 | | |
3211 | 3219 | | |
| |||
0 commit comments