🥅 handle situation where git doesn't exist in workspace
This commit is contained in:
parent
ca442c6b33
commit
05a5e154c5
1 changed files with 8 additions and 2 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue