| ... | @@ -664,6 +664,38 @@ const makeGitCore = Effect.gen(function* () { | ... | @@ -664,6 +664,38 @@ const makeGitCore = Effect.gen(function* () { |
| 664 | ); | 664 | ); |
| 665 | } | 665 | } |
| 666 | | 666 | |
| | 667 | const remoteBranchResultEffect = executeGit( |
| | 668 | "GitCore.listBranches.remoteBranches", |
| | 669 | input.cwd, |
| | 670 | ["branch", "--no-color", "--remotes"], |
| | 671 | { |
| | 672 | timeoutMs: 10_000, |
| | 673 | allowNonZeroExit: true, |
| | 674 | }, |
| | 675 | ).pipe( |
| | 676 | Effect.catch((error) => |
| | 677 | Effect.logWarning( |
| | 678 | `GitCore.listBranches: remote branch lookup failed for ${input.cwd}: ${error.message}. Falling back to an empty remote branch list.`, |
| | 679 | ).pipe(Effect.as({ code: 1, stdout: "", stderr: "" })), |
| | 680 | ), |
| | 681 | ); |
| | 682 | |
| | 683 | const remoteNamesResultEffect = executeGit( |
| | 684 | "GitCore.listBranches.remoteNames", |
| | 685 | input.cwd, |
| | 686 | ["remote"], |
| | 687 | { |
| | 688 | timeoutMs: 5_000, |
| | 689 | allowNonZeroExit: true, |
| | 690 | }, |
| | 691 | ).pipe( |
| | 692 | Effect.catch((error) => |
| | 693 | Effect.logWarning( |
| | 694 | `GitCore.listBranches: remote name lookup failed for ${input.cwd}: ${error.message}. Falling back to an empty remote name list.`, |
| | 695 | ).pipe(Effect.as({ code: 1, stdout: "", stderr: "" })), |
| | 696 | ), |
| | 697 | ); |
| | 698 | |
| 667 | const [defaultRef, worktreeList, remoteBranchResult, remoteNamesResult, branchLastCommit] = | 699 | const [defaultRef, worktreeList, remoteBranchResult, remoteNamesResult, branchLastCommit] = |
| 668 | yield* Effect.all( | 700 | yield* Effect.all( |
| 669 | [ | 701 | [ |
| ... | @@ -685,25 +717,24 @@ const makeGitCore = Effect.gen(function* () { | ... | @@ -685,25 +717,24 @@ const makeGitCore = Effect.gen(function* () { |
| 685 | allowNonZeroExit: true, | 717 | allowNonZeroExit: true, |
| 686 | }, | 718 | }, |
| 687 | ), | 719 | ), |
| 688 | executeGit( | 720 | remoteBranchResultEffect, |
| 689 | "GitCore.listBranches.remoteBranches", | 721 | remoteNamesResultEffect, |
| 690 | input.cwd, | | |
| 691 | ["branch", "--no-color", "--remotes"], | | |
| 692 | { | | |
| 693 | timeoutMs: 10_000, | | |
| 694 | allowNonZeroExit: true, | | |
| 695 | }, | | |
| 696 | ), | | |
| 697 | executeGit("GitCore.listBranches.remoteNames", input.cwd, ["remote"], { | | |
| 698 | timeoutMs: 5_000, | | |
| 699 | allowNonZeroExit: true, | | |
| 700 | }), | | |
| 701 | branchRecencyPromise, | 722 | branchRecencyPromise, |
| 702 | ], | 723 | ], |
| 703 | { concurrency: "unbounded" }, | 724 | { concurrency: "unbounded" }, |
| 704 | ); | 725 | ); |
| 705 | | 726 | |
| 706 | const remoteNames = remoteNamesResult.code === 0 ? parseRemoteNames(remoteNamesResult.stdout) : []; | 727 | const remoteNames = remoteNamesResult.code === 0 ? parseRemoteNames(remoteNamesResult.stdout) : []; |
| | 728 | if (remoteBranchResult.code !== 0 && remoteBranchResult.stderr.trim().length > 0) { |
| | 729 | yield* Effect.logWarning( |
| | 730 | `GitCore.listBranches: remote branch lookup returned code ${remoteBranchResult.code} for ${input.cwd}: ${remoteBranchResult.stderr.trim()}. Falling back to an empty remote branch list.`, |
| | 731 | ); |
| | 732 | } |
| | 733 | if (remoteNamesResult.code !== 0 && remoteNamesResult.stderr.trim().length > 0) { |
| | 734 | yield* Effect.logWarning( |
| | 735 | `GitCore.listBranches: remote name lookup returned code ${remoteNamesResult.code} for ${input.cwd}: ${remoteNamesResult.stderr.trim()}. Falling back to an empty remote name list.`, |
| | 736 | ); |
| | 737 | } |
| 707 | | 738 | |
| 708 | const defaultBranch = | 739 | const defaultBranch = |
| 709 | defaultRef.code === 0 | 740 | defaultRef.code === 0 |