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