Commit eec8a5e
authored
fix(worktree): resolve the repo's real remote+default branch, not hardcoded origin/main (INT-2545) (#271)
The daemon could not do code work on entire repos. createWorktree() +
commitAndCreatePR() hardcoded 'origin/main' everywhere, so any repo that doesn't
match BOTH assumptions failed at the very first step:
- default branch is 'master' (pykiwoom-rest, ArtifactNet) → 'git worktree add …
origin/main' died with 'fatal: invalid reference: origin/main' → worktree creation
failed → the issue could NEVER be worked (observed live: the dominant daemon error,
every STO-* task stuck);
- remote isn't named 'origin' (vega-agent uses 'unohee') → same failure.
resolveBaseRef(gitDir) now resolves {remote, branch, ref}: prefer <remote>/HEAD,
fall back to main then master; pick 'origin' if present else the first remote. Wired
through the whole create→commits-ahead→push→PR chain and the overlap report, so
master-default and non-origin repos work end to end (create from the real base, push
to the real remote, PR against the real base branch).
Tests: resolveBaseRef over origin/main, origin/master, and a non-origin remote;
createWorktree succeeds on a master-default repo and a non-origin repo; and
commitAndCreatePR (fake gh on PATH) pushes to the resolved remote and PRs against the
resolved base. tsc + oxlint clean, full suite 148 files / 1760 passed; openswarm review APPROVE.1 parent 0fcf46b commit eec8a5e
2 files changed
Lines changed: 155 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
| 388 | + | |
| 389 | + | |
| 390 | + | |
| 391 | + | |
| 392 | + | |
| 393 | + | |
| 394 | + | |
| 395 | + | |
| 396 | + | |
| 397 | + | |
| 398 | + | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
| 402 | + | |
| 403 | + | |
| 404 | + | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
| 408 | + | |
| 409 | + | |
| 410 | + | |
| 411 | + | |
| 412 | + | |
| 413 | + | |
| 414 | + | |
| 415 | + | |
| 416 | + | |
| 417 | + | |
| 418 | + | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
| 440 | + | |
| 441 | + | |
| 442 | + | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
| 446 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
41 | 73 | | |
42 | 74 | | |
43 | 75 | | |
| |||
312 | 344 | | |
313 | 345 | | |
314 | 346 | | |
315 | | - | |
316 | | - | |
317 | | - | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
| 350 | + | |
| 351 | + | |
| 352 | + | |
318 | 353 | | |
319 | 354 | | |
320 | | - | |
321 | | - | |
322 | | - | |
| 355 | + | |
| 356 | + | |
| 357 | + | |
323 | 358 | | |
324 | 359 | | |
325 | 360 | | |
| |||
405 | 440 | | |
406 | 441 | | |
407 | 442 | | |
408 | | - | |
409 | | - | |
| 443 | + | |
| 444 | + | |
| 445 | + | |
410 | 446 | | |
411 | 447 | | |
412 | 448 | | |
413 | | - | |
414 | | - | |
| 449 | + | |
| 450 | + | |
415 | 451 | | |
416 | 452 | | |
417 | 453 | | |
| |||
425 | 461 | | |
426 | 462 | | |
427 | 463 | | |
428 | | - | |
| 464 | + | |
| 465 | + | |
429 | 466 | | |
430 | 467 | | |
431 | 468 | | |
| |||
463 | 500 | | |
464 | 501 | | |
465 | 502 | | |
466 | | - | |
467 | | - | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
468 | 507 | | |
469 | 508 | | |
470 | 509 | | |
471 | 510 | | |
472 | | - | |
473 | | - | |
| 511 | + | |
| 512 | + | |
474 | 513 | | |
475 | 514 | | |
476 | | - | |
| 515 | + | |
477 | 516 | | |
478 | | - | |
479 | | - | |
| 517 | + | |
| 518 | + | |
480 | 519 | | |
481 | 520 | | |
482 | 521 | | |
| |||
504 | 543 | | |
505 | 544 | | |
506 | 545 | | |
507 | | - | |
| 546 | + | |
508 | 547 | | |
509 | 548 | | |
510 | 549 | | |
| |||
0 commit comments