This commit is contained in:
João Moreno
2020-11-06 14:45:17 +01:00
parent 0cc93f5c48
commit ce4fb6e323
6 changed files with 53 additions and 28 deletions

View File

@@ -1299,13 +1299,17 @@ export class Repository {
await this.run(['update-index', add, '--cacheinfo', mode, hash, path]);
}
async checkout(treeish: string, paths: string[], opts: { track?: boolean } = Object.create(null)): Promise<void> {
async checkout(treeish: string, paths: string[], opts: { track?: boolean, detached?: boolean } = Object.create(null)): Promise<void> {
const args = ['checkout', '-q'];
if (opts.track) {
args.push('--track');
}
if (opts.detached) {
args.push('--detach');
}
if (treeish) {
args.push(treeish);
}