mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-17 11:24:29 -05:00
Handle nonmaster branches in user suite tests (#48128)
* Handle nonmaster branches in user suite tests * Fix remaining changed default branches, vscode & vue-next docker install scripts * NPM reformats these on install now, comitting so it doesnt need to be ignored * Accept current user suite baselines * Fix many trivially fixable user suite tests
This commit is contained in:
@@ -12,6 +12,7 @@ namespace Harness {
|
||||
interface UserConfig {
|
||||
types: string[];
|
||||
cloneUrl: string;
|
||||
branch?: string;
|
||||
path?: string;
|
||||
}
|
||||
|
||||
@@ -56,9 +57,10 @@ 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", ["--work-tree", submoduleDir, "clone", config.cloneUrl, path.join(submoduleDir, ".git")], { cwd });
|
||||
exec("git", ["--work-tree", submoduleDir, "clone", "-b", config.branch || "master", config.cloneUrl, path.join(submoduleDir, ".git")], { cwd });
|
||||
}
|
||||
else {
|
||||
exec("git", ["--git-dir", path.join(submoduleDir, ".git"), "--work-tree", submoduleDir, "checkout", config.branch || "master"], { 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 });
|
||||
|
||||
Reference in New Issue
Block a user