Skip to content

Commit

Permalink
Add --git-dir and --work-tree to user tests (microsoft#35362)
Browse files Browse the repository at this point in the history
  • Loading branch information
jablko authored Feb 12, 2020
1 parent 7a1c5b7 commit 98492d8
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/testRunner/externalCompileRunner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ namespace Harness {
ts.Debug.assert(!!config.cloneUrl, "Bad format from test.json: cloneUrl field must be present.");
const submoduleDir = path.join(cwd, directoryName);
if (!fs.existsSync(submoduleDir)) {
exec("git", ["clone", config.cloneUrl, directoryName], { cwd });
exec("git", ["--work-tree", submoduleDir, "clone", config.cloneUrl, path.join(submoduleDir, ".git")], { cwd });
}
else {
exec("git", ["reset", "HEAD", "--hard"], { cwd: submoduleDir });
exec("git", ["clean", "-f"], { cwd: submoduleDir });
exec("git", ["pull", "-f"], { cwd: submoduleDir });
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "reset", "HEAD", "--hard"], { cwd: submoduleDir });
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "clean", "-f"], { cwd: submoduleDir });
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "pull", "-f"], { cwd: submoduleDir });
}

types = config.types;
Expand Down

0 comments on commit 98492d8

Please sign in to comment.