-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: fix test env git safe directory issue
- Loading branch information
erguotou
committed
Jan 6, 2025
1 parent
20a5776
commit 4517994
Showing
2 changed files
with
23 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,12 +12,14 @@ test.beforeEach('mkdir test dir', async (t) => { | |
execSync('git config --global init.defaultBranch main') | ||
execSync('git config --global user.email "[email protected]"') | ||
execSync('git config --global user.name "Test User"') | ||
// 添加安全目录配置,否则会报错 | ||
execSync('git config --global --add safe.directory "*"') | ||
execSync('git init') | ||
await new Promise(resolve => setTimeout(resolve, 100)) | ||
// await new Promise(resolve => setTimeout(resolve, 100)) | ||
console.log('Finish git init') | ||
execSync('git rev-parse --is-inside-work-tree', { | ||
stdio: 'inherit', | ||
}) | ||
// execSync('git rev-parse --is-inside-work-tree', { | ||
// stdio: 'inherit', | ||
// }) | ||
}) | ||
test.afterEach('rm test dir', async (t) => { | ||
// process.chdir(startDir) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters