🥅 handle situation where git doesn't exist in workspace

This commit is contained in:
Nate Sesti 2024-04-12 09:14:41 -07:00
parent ca442c6b33
commit 05a5e154c5

View file

@ -503,8 +503,14 @@ export class VsCodeIdeUtils {
return undefined;
}
const git = extension.exports.getAPI(1);
return git.getRepository(forDirectory);
try {
const git = extension.exports.getAPI(1);
return git.getRepository(forDirectory);
} catch (e) {
this._repoWasNone = true;
console.warn("Git not found: ", e);
return undefined;
}
}
private _repoWasNone: boolean = false;