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 6d0725e commit 9bb8292
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/worktree.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,16 +105,22 @@ export async function generateWorktree(

try {
checkout = new GitCheckout(branchName, `origin/${action.branch}`)

await execute(
checkout.toString(),
`${action.workspace}/${worktreedir}`,
action.silent
)
} catch (error) {
info('Unable to track the origin branch…')
checkout = new GitCheckout(branchName)
}

await execute(
checkout.toString(),
`${action.workspace}/${worktreedir}`,
action.silent
)
await execute(
checkout.toString(),
`${action.workspace}/${worktreedir}`,
action.silent
)
}
}

if (!branchExists) {
Expand Down

0 comments on commit 9bb8292

Please sign in to comment.