Skip to content

Commit 10610cd

Browse files
committed
fix: apply potential fix
1 parent 56d4ca7 commit 10610cd

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/worktree.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,20 @@ export async function generateWorktree(
129129
)
130130
}
131131
}
132+
133+
/**
134+
* Ensure that the workspace is a safe directory.
135+
*/
136+
try {
137+
await execute(
138+
`git config --global --add safe.directory "${action.workspace}/${worktreedir}"`,
139+
action.workspace,
140+
action.silent
141+
)
142+
} catch {
143+
info('Unable to set worktree temp directory as a safe directory…')
144+
}
145+
132146
} catch (error) {
133147
throw new Error(
134148
`There was an error creating the worktree: ${suppressSensitiveInformation(

0 commit comments

Comments
 (0)