mirror of
https://github.com/ckaczor/vscode-gitlens.git
synced 2026-02-16 18:48:45 -05:00
Fixes exception trapping
This commit is contained in:
@@ -129,10 +129,11 @@ export default class Git {
|
|||||||
return gitCommand(repoPath, ...params);
|
return gitCommand(repoPath, ...params);
|
||||||
}
|
}
|
||||||
|
|
||||||
static getVersionedFile(fileName: string, repoPath: string, sha: string) {
|
static async getVersionedFile(fileName: string, repoPath: string, sha: string) {
|
||||||
return new Promise<string>((resolve, reject) => {
|
const data = await Git.getVersionedFileText(fileName, repoPath, sha);
|
||||||
Git.getVersionedFileText(fileName, repoPath, sha).then(data => {
|
|
||||||
const ext = path.extname(fileName);
|
const ext = path.extname(fileName);
|
||||||
|
return new Promise<string>((resolve, reject) => {
|
||||||
tmp.file({ prefix: `${path.basename(fileName, ext)}-${sha}__`, postfix: ext },
|
tmp.file({ prefix: `${path.basename(fileName, ext)}-${sha}__`, postfix: ext },
|
||||||
(err, destination, fd, cleanupCallback) => {
|
(err, destination, fd, cleanupCallback) => {
|
||||||
if (err) {
|
if (err) {
|
||||||
@@ -146,11 +147,11 @@ export default class Git {
|
|||||||
reject(err);
|
reject(err);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
resolve(destination);
|
resolve(destination);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static getVersionedFileText(fileName: string, repoPath: string, sha: string) {
|
static getVersionedFileText(fileName: string, repoPath: string, sha: string) {
|
||||||
|
|||||||
Reference in New Issue
Block a user