Skip to content

Commit 3ef366d

Browse files
committed
Add --git-dir and --work-tree to user tests
1 parent 7c14aff commit 3ef366d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/testRunner/externalCompileRunner.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -55,11 +55,11 @@ abstract class ExternalCompileRunnerBase extends RunnerBase {
5555
ts.Debug.assert(!!config.cloneUrl, "Bad format from test.json: cloneUrl field must be present.");
5656
const submoduleDir = path.join(cwd, directoryName);
5757
if (!fs.existsSync(submoduleDir)) {
58-
exec("git", ["clone", config.cloneUrl, directoryName], { cwd });
58+
exec("git", ["--work-tree", submoduleDir, "clone", config.cloneUrl, path.join(submoduleDir, ".git")], { cwd });
5959
}
60-
exec("git", ["reset", "HEAD", "--hard"], { cwd: submoduleDir });
61-
exec("git", ["clean", "-f"], { cwd: submoduleDir });
62-
exec("git", ["pull", "-f"], { cwd: submoduleDir });
60+
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "reset", "HEAD", "--hard"], { cwd: submoduleDir });
61+
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "clean", "-f"], { cwd: submoduleDir });
62+
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "pull", "-f"], { cwd: submoduleDir });
6363

6464
types = config.types;
6565

0 commit comments

Comments
 (0)