Skip to content

Commit

Permalink
Update worktree.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
JamesIves committed Sep 29, 2024
1 parent 3b0b9cb commit 84c87e3
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/worktree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -101,11 +101,13 @@ export async function generateWorktree(
'Error encountered while checking out branch. Attempting to continue with a new branch name.'
)

await execute(
`git fetch origin ${action.branch}`,
`${action.workspace}/${worktreedir}`,
action.silent
)
if (branchExists) {
await execute(
`git fetch --no-recurse-submodules --depth=1 origin ${action.branch}`,
`${action.workspace}/${worktreedir}`,
action.silent
)
}

branchName = `temp-${Date.now()}`
checkout = new GitCheckout(branchName, `origin/${action.branch}`)
Expand Down

0 comments on commit 84c87e3

Please sign in to comment.