Skip to content

Commit 4ecc785

Browse files
committed
Fix win32 tests
1 parent 8a48d37 commit 4ecc785

1 file changed

Lines changed: 30 additions & 5 deletions

File tree

‎test/runner.js‎

Lines changed: 30 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,31 @@ var NodeGit = require('..');
88
var workdirPath = local("repos/workdir");
99
var constWorkdirPath = local("repos/constworkdir");
1010

11+
const testRepos = [
12+
"repos/bare",
13+
"repos/blameRepo",
14+
"repos/cherrypick",
15+
"repos/clone",
16+
"repos/constworkdir",
17+
"repos/convenientLineTest",
18+
"repos/empty",
19+
"repos/index",
20+
"repos/index",
21+
"repos/merge",
22+
"repos/merge-head",
23+
"repos/new",
24+
"repos/newrepo",
25+
"repos/nonrepo",
26+
"repos/rebase",
27+
"repos/renamedFileRepo",
28+
"repos/revertRepo",
29+
"repos/stagingRepo",
30+
"repos/submodule",
31+
"repos/submodule/nodegittest/",
32+
"repos/tree/",
33+
"repos/workdir",
34+
];
35+
1136
before(function() {
1237
this.timeout(350000);
1338

@@ -62,12 +87,12 @@ before(function() {
6287
return fse.writeFile(local("home", ".gitconfig"),
6388
"[user]\n name = John Doe\n email = johndoe@example.com");
6489
})
65-
.then(function() {
66-
return exec(`git config --global --add safe.directory ${workdirPath}`);
90+
.then( async function() {
91+
//mark all test repos as safe
92+
for(let repo of testRepos) {
93+
await exec(`git config --global --add safe.directory ${local(repo)}`);
94+
}
6795
})
68-
.then(function() {
69-
return exec(`git config --global --add safe.directory ${constWorkdirPath}`);
70-
});
7196
});
7297

7398
beforeEach(function() {

0 commit comments

Comments
 (0)