Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
private async _checkout(branch: string) {
this._index.splice(0, this._index.length);
await checkout({
dir: this.projectDir,
ref: branch
});
}
async checkout() {
log(`Attempting to checkout at ${this.finalPath}`);
await mkdir(this.finalPath);
await git.checkout({
gitdir: this.clonePath,
dir: this.finalPath,
ref: this.repo.sha
});
}
export async function checkoutBranch(
projectRoot: string,
branchName: string
): Promise {
return git.checkout({ dir: projectRoot, ref: branchName })
}
export async function checkoutBranch(
projectRoot: string,
branchName: string
): Promise {
return git.checkout({ fs, dir: projectRoot, ref: branchName })
}