Skip to content

Commit 43a8908

Browse files
committed
Remove unnecessary git checkout scope requirement
1 parent 019345b commit 43a8908

3 files changed

Lines changed: 12 additions & 20 deletions

File tree

apps/server/src/git/Layers/GitCore.ts

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2190,16 +2190,14 @@ export const makeGitCore = Effect.fn("makeGitCore")(function* (options?: {
21902190
fallbackErrorMessage: "git branch create failed",
21912191
});
21922192
if (input.checkout) {
2193-
yield* Effect.scoped(
2194-
checkoutBranch({ cwd: input.cwd, branch: input.branch }).pipe(
2195-
Effect.catchTag("GitCheckoutDirtyWorktreeError", (e) =>
2196-
Effect.fail(
2197-
createGitCommandError(
2198-
"GitCore.createBranch.checkout",
2199-
input.cwd,
2200-
["checkout", input.branch],
2201-
e.message,
2202-
),
2193+
yield* checkoutBranch({ cwd: input.cwd, branch: input.branch }).pipe(
2194+
Effect.catchTag("GitCheckoutDirtyWorktreeError", (e) =>
2195+
Effect.fail(
2196+
createGitCommandError(
2197+
"GitCore.createBranch.checkout",
2198+
input.cwd,
2199+
["checkout", input.branch],
2200+
e.message,
22032201
),
22042202
),
22052203
),

apps/server/src/git/Layers/GitManager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1529,7 +1529,7 @@ export const makeGitManager = Effect.fn("makeGitManager")(function* () {
15291529
const resolvedBranch = resolveAutoFeatureBranchName(existingBranchNames, preferredBranch);
15301530

15311531
yield* gitCore.createBranch({ cwd, branch: resolvedBranch });
1532-
yield* Effect.scoped(gitCore.checkoutBranch({ cwd, branch: resolvedBranch }));
1532+
yield* gitCore.checkoutBranch({ cwd, branch: resolvedBranch });
15331533

15341534
return {
15351535
branchStep: { status: "created" as const, name: resolvedBranch },

apps/server/src/git/Services/GitCore.ts

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* @module GitCore
88
*/
99
import { Context } from "effect";
10-
import type { Effect, Scope } from "effect";
10+
import type { Effect } from "effect";
1111
import type {
1212
GitCheckoutInput,
1313
GitCheckoutResult,
@@ -294,15 +294,9 @@ export interface GitCoreShape {
294294
*/
295295
readonly checkoutBranch: (
296296
input: GitCheckoutInput,
297-
) => Effect.Effect<
298-
GitCheckoutResult,
299-
GitCommandError | GitCheckoutDirtyWorktreeError,
300-
Scope.Scope
301-
>;
297+
) => Effect.Effect<GitCheckoutResult, GitCommandError | GitCheckoutDirtyWorktreeError>;
302298

303-
readonly stashAndCheckout: (
304-
input: GitCheckoutInput,
305-
) => Effect.Effect<void, GitCommandError, Scope.Scope>;
299+
readonly stashAndCheckout: (input: GitCheckoutInput) => Effect.Effect<void, GitCommandError>;
306300

307301
readonly stashDrop: (cwd: string) => Effect.Effect<void, GitCommandError>;
308302

0 commit comments

Comments
 (0)