| ... | ... | @@ -139,7 +139,7 @@ interface GitRefsSnapshot { |
| 139 | 139 | |
| 140 | 140 | interface ExecuteGitOptions { |
| 141 | 141 | stdin?: string | undefined; |
| 142 | | timeoutMs?: number | undefined; |
| 142 | timeoutMs?: number | null | undefined; |
| 143 | 143 | allowNonZeroExit?: boolean | undefined; |
| 144 | 144 | fallbackErrorDetail?: string | undefined; |
| 145 | 145 | env?: NodeJS.ProcessEnv | undefined; |
| ... | ... | @@ -712,7 +712,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 712 | 712 | ...input, |
| 713 | 713 | args: [...input.args], |
| 714 | 714 | } as const; |
| 715 | | const timeoutMs = input.timeoutMs ?? DEFAULT_TIMEOUT_MS; |
| 715 | const timeoutMs = input.timeoutMs === undefined ? DEFAULT_TIMEOUT_MS : input.timeoutMs; |
| 716 | 716 | const maxOutputBytes = input.maxOutputBytes ?? DEFAULT_MAX_OUTPUT_BYTES; |
| 717 | 717 | const appendTruncationMarker = input.appendTruncationMarker ?? false; |
| 718 | 718 | |
| ... | ... | @@ -813,8 +813,12 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 813 | 813 | } satisfies GitVcsDriver.ExecuteGitResult; |
| 814 | 814 | }); |
| 815 | 815 | |
| 816 | | return yield* runGitCommand().pipe( |
| 817 | | Effect.scoped, |
| 816 | const execution = runGitCommand().pipe(Effect.scoped); |
| 817 | if (timeoutMs === null) { |
| 818 | return yield* execution; |
| 819 | } |
| 820 | |
| 821 | return yield* execution.pipe( |
| 818 | 822 | Effect.timeoutOption(timeoutMs), |
| 819 | 823 | Effect.flatMap((result) => |
| 820 | 824 | Option.match(result, { |
| ... | ... | @@ -905,9 +909,9 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 905 | 909 | operation: string, |
| 906 | 910 | cwd: string, |
| 907 | 911 | args: readonly string[], |
| 908 | | allowNonZeroExit = false, |
| 912 | options: ExecuteGitOptions = {}, |
| 909 | 913 | ): Effect.Effect<void, GitCommandError> => |
| 910 | | executeGit(operation, cwd, args, { allowNonZeroExit }).pipe(Effect.asVoid); |
| 914 | executeGit(operation, cwd, args, options).pipe(Effect.asVoid); |
| 911 | 915 | |
| 912 | 916 | const runGitStdout = ( |
| 913 | 917 | operation: string, |
| ... | ... | @@ -1905,12 +1909,12 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 1905 | 1909 | const requestedRemoteName = options?.remoteName?.trim() || null; |
| 1906 | 1910 | if (requestedRemoteName) { |
| 1907 | 1911 | const publishBranch = yield* resolvePublishBranchName(cwd, branch); |
| 1908 | | yield* runGit("GitVcsDriver.pushCurrentBranch.pushWithRequestedRemote", cwd, [ |
| 1909 | | "push", |
| 1910 | | "-u", |
| 1911 | | requestedRemoteName, |
| 1912 | | `HEAD:refs/heads/${publishBranch}`, |
| 1913 | | ]); |
| 1912 | yield* runGit( |
| 1913 | "GitVcsDriver.pushCurrentBranch.pushWithRequestedRemote", |
| 1914 | cwd, |
| 1915 | ["push", "-u", requestedRemoteName, `HEAD:refs/heads/${publishBranch}`], |
| 1916 | { timeoutMs: null }, |
| 1917 | ); |
| 1914 | 1918 | return { |
| 1915 | 1919 | status: "pushed" as const, |
| 1916 | 1920 | branch, |
| ... | ... | @@ -1968,12 +1972,12 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 1968 | 1972 | }); |
| 1969 | 1973 | } |
| 1970 | 1974 | const publishBranch = yield* resolvePublishBranchName(cwd, branch); |
| 1971 | | yield* runGit("GitVcsDriver.pushCurrentBranch.pushWithUpstream", cwd, [ |
| 1972 | | "push", |
| 1973 | | "-u", |
| 1974 | | publishRemoteName, |
| 1975 | | `HEAD:refs/heads/${publishBranch}`, |
| 1976 | | ]); |
| 1975 | yield* runGit( |
| 1976 | "GitVcsDriver.pushCurrentBranch.pushWithUpstream", |
| 1977 | cwd, |
| 1978 | ["push", "-u", publishRemoteName, `HEAD:refs/heads/${publishBranch}`], |
| 1979 | { timeoutMs: null }, |
| 1980 | ); |
| 1977 | 1981 | return { |
| 1978 | 1982 | status: "pushed" as const, |
| 1979 | 1983 | branch, |
| ... | ... | @@ -1986,11 +1990,12 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 1986 | 1990 | Effect.orElseSucceed(() => null), |
| 1987 | 1991 | ); |
| 1988 | 1992 | if (currentUpstream) { |
| 1989 | | yield* runGit("GitVcsDriver.pushCurrentBranch.pushUpstream", cwd, [ |
| 1990 | | "push", |
| 1991 | | currentUpstream.remoteName, |
| 1992 | | `HEAD:refs/heads/${currentUpstream.branchName}`, |
| 1993 | | ]); |
| 1993 | yield* runGit( |
| 1994 | "GitVcsDriver.pushCurrentBranch.pushUpstream", |
| 1995 | cwd, |
| 1996 | ["push", currentUpstream.remoteName, `HEAD:refs/heads/${currentUpstream.branchName}`], |
| 1997 | { timeoutMs: null }, |
| 1998 | ); |
| 1994 | 1999 | return { |
| 1995 | 2000 | status: "pushed" as const, |
| 1996 | 2001 | branch, |
| ... | ... | @@ -1999,7 +2004,7 @@ export const makeGitVcsDriverCore = Effect.fn("makeGitVcsDriverCore")(function* |
| 1999 | 2004 | }; |
| 2000 | 2005 | } |
| 2001 | 2006 | |
| 2002 | | yield* runGit("GitVcsDriver.pushCurrentBranch.push", cwd, ["push"]); |
| 2007 | yield* runGit("GitVcsDriver.pushCurrentBranch.push", cwd, ["push"], { timeoutMs: null }); |
| 2003 | 2008 | return { |
| 2004 | 2009 | status: "pushed" as const, |
| 2005 | 2010 | branch, |