Skip to content

Commit 0c6bce4

Browse files
committed
Deploy Production Code for Commit fb1eb73 🚀
1 parent fb1eb73 commit 0c6bce4

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/worktree.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ function generateWorktree(action, worktreedir, branchExists) {
8080
catch (error) {
8181
(0, core_1.info)('Error encountered while checking out branch. Attempting to continue with a new branch name.');
8282
branchName = `temp-${Date.now()}`;
83-
checkout = new GitCheckout(branchName, `origin/${action.branch}`);
83+
checkout = new GitCheckout(branchName);
8484
yield (0, execute_1.execute)(checkout.toString(), `${action.workspace}/${worktreedir}`, action.silent);
8585
}
8686
if (!branchExists) {
@@ -91,6 +91,15 @@ function generateWorktree(action, worktreedir, branchExists) {
9191
// New history isn't singleCommit, create empty initial commit
9292
yield (0, execute_1.execute)(`git commit --no-verify --allow-empty -m "Initial ${branchName} commit"`, `${action.workspace}/${worktreedir}`, action.silent);
9393
}
94+
/**
95+
* Ensure that the workspace is a safe directory.
96+
*/
97+
try {
98+
yield (0, execute_1.execute)(`git config --global --add safe.directory "${action.workspace}/${worktreedir}"`, action.workspace, action.silent);
99+
}
100+
catch (_a) {
101+
(0, core_1.info)('Unable to set worktree temp directory as a safe directory…');
102+
}
94103
}
95104
}
96105
catch (error) {

0 commit comments

Comments
 (0)