mirror of
https://github.com/getpaseo/paseo.git
synced 2026-11-03 23:23:21 +00:00
fix(migrate): preserve checkout and shell semantics
This commit is contained in:
@@ -1226,7 +1226,6 @@ export const createWorktree = async ({
|
||||
paseoHome,
|
||||
worktreesRoot,
|
||||
}: CreateWorktreeOptions): Promise<WorktreeConfig> => {
|
||||
await pruneVerifiedStaleWorktrees(cwd);
|
||||
const sourcePlan = await resolveWorktreeSourcePlan({ cwd, source, desiredSlug: worktreeSlug });
|
||||
let worktreePath = join(await getPaseoWorktreesRoot(cwd, paseoHome, worktreesRoot), worktreeSlug);
|
||||
mkdirSync(dirname(worktreePath), { recursive: true });
|
||||
@@ -1284,16 +1283,6 @@ export const createWorktree = async ({
|
||||
};
|
||||
};
|
||||
|
||||
async function pruneVerifiedStaleWorktrees(cwd: string): Promise<void> {
|
||||
const { stdout } = await runGitCommand(["worktree", "list", "--porcelain"], {
|
||||
cwd,
|
||||
envOverlay: READ_ONLY_GIT_ENV,
|
||||
});
|
||||
const hasStaleRegistration = parseWorktreeList(stdout).some((entry) => !existsSync(entry.path));
|
||||
if (!hasStaleRegistration) return;
|
||||
await runGitCommand(["worktree", "prune"], { cwd, timeout: 30_000 });
|
||||
}
|
||||
|
||||
interface ResolveWorktreeSourcePlanOptions {
|
||||
cwd: string;
|
||||
source: WorktreeSource;
|
||||
|
||||
Reference in New Issue
Block a user