Reworks git command error handling

Switches to use the new diffWith command
This commit is contained in:
Eric Amodio
2017-09-11 00:39:52 -04:00
parent d420d82ab2
commit 4102bdd471
14 changed files with 230 additions and 237 deletions

View File

@@ -15,7 +15,9 @@ export class GitContentProvider implements TextDocumentContentProvider {
const data = GitService.fromGitContentUri(uri);
const fileName = data.originalFileName || data.fileName;
try {
let text = await this.git.getVersionedFileText(data.repoPath, fileName, data.sha);
let text = data.sha !== GitService.fakeSha
? await this.git.getVersionedFileText(data.repoPath, fileName, data.sha)
: '';
if (data.decoration) {
text = `${data.decoration}\n${text}`;
}