Skip to content

Commit a0a04df

Browse files
committed
Add --git-dir and --work-tree to user tests
1 parent 7726464 commit a0a04df

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/testRunner/externalCompileRunner.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ namespace Harness {
5656
ts.Debug.assert(!!config.cloneUrl, "Bad format from test.json: cloneUrl field must be present.");
5757
const submoduleDir = path.join(cwd, directoryName);
5858
if (!fs.existsSync(submoduleDir)) {
59-
exec("git", ["clone", config.cloneUrl, directoryName], { cwd });
59+
exec("git", ["--work-tree", submoduleDir, "clone", config.cloneUrl, path.join(submoduleDir, ".git")], { cwd });
6060
}
61-
exec("git", ["reset", "HEAD", "--hard"], { cwd: submoduleDir });
62-
exec("git", ["clean", "-f"], { cwd: submoduleDir });
63-
exec("git", ["pull", "-f"], { cwd: submoduleDir });
61+
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "reset", "HEAD", "--hard"], { cwd: submoduleDir });
62+
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "clean", "-f"], { cwd: submoduleDir });
63+
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "pull", "-f"], { cwd: submoduleDir });
6464

6565
types = config.types;
6666

@@ -337,4 +337,4 @@ ${stderr.replace(/\r\n/g, "\n")}`;
337337
}
338338
return result;
339339
}
340-
}
340+
}

0 commit comments

Comments
 (0)