add git CommandErrorOutputTextDocumentContentProvider

This commit is contained in:
João Moreno
2020-11-05 16:46:42 +01:00
parent ec471da613
commit 49990bebe4
2 changed files with 49 additions and 17 deletions

View File

@@ -260,6 +260,7 @@ export interface IGitErrorData {
exitCode?: number;
gitErrorCode?: string;
gitCommand?: string;
gitArgs?: string[];
}
export class GitError {
@@ -271,6 +272,7 @@ export class GitError {
exitCode?: number;
gitErrorCode?: string;
gitCommand?: string;
gitArgs?: string[];
constructor(data: IGitErrorData) {
if (data.error) {
@@ -287,6 +289,7 @@ export class GitError {
this.exitCode = data.exitCode;
this.gitErrorCode = data.gitErrorCode;
this.gitCommand = data.gitCommand;
this.gitArgs = data.gitArgs;
}
toString(): string {
@@ -535,7 +538,8 @@ export class Git {
stderr: result.stderr,
exitCode: result.exitCode,
gitErrorCode: getGitErrorCode(result.stderr),
gitCommand: args[0]
gitCommand: args[0],
gitArgs: args
}));
}
@@ -1781,7 +1785,8 @@ export class Repository {
stderr,
exitCode,
gitErrorCode: getGitErrorCode(stderr),
gitCommand: 'status'
gitCommand: 'status',
gitArgs: args
}));
}