| 131 | }) |
| 132 | |
| 133 | const removeWorktree = (repoRoot: string, worktree: string): Effect.Effect<void> => |
| 134 | runCommand("git", ["worktree", "remove", "--force", worktree], repoRoot).pipe( |
| 135 | Effect.flatMap((result) => |
| 136 | result.exitCode === ChildProcessSpawner.ExitCode(0) |
| 137 | ? Effect.void |
| 138 | : Console.error(result.output) |
| 139 | ), |
| 140 | Effect.catch((error) => Console.error(error.message)) |
| 141 | ) |
| 142 | |
| 143 | const resolveRef = Effect.fnUntraced(function*(repoRoot: string, ref: string) { |
| 144 | return yield* runChecked("git", ["rev-parse", "--verify", `${ref}^{commit}`], repoRoot) |