mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 13:43:07 +00:00
Merge pull request #64619 from Microsoft/rmacfarlane/git-apply
Add GitErrorCode to apply command
This commit is contained in:
commit
0cdd4b1241
2 changed files with 10 additions and 1 deletions
1
extensions/git/src/api/git.d.ts
vendored
1
extensions/git/src/api/git.d.ts
vendored
|
@ -214,4 +214,5 @@ export const enum GitErrorCodes {
|
|||
WrongCase = 'WrongCase',
|
||||
CantLockRef = 'CantLockRef',
|
||||
CantRebaseMultipleBranches = 'CantRebaseMultipleBranches',
|
||||
PatchDoesNotApply = 'PatchDoesNotApply'
|
||||
}
|
|
@ -829,7 +829,15 @@ export class Repository {
|
|||
args.push('-R');
|
||||
}
|
||||
|
||||
await this.run(args);
|
||||
try {
|
||||
await this.run(args);
|
||||
} catch (err) {
|
||||
if (/patch does not apply/.test(err.stderr)) {
|
||||
err.gitErrorCode = GitErrorCodes.PatchDoesNotApply;
|
||||
}
|
||||
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
async diff(cached = false): Promise<string> {
|
||||
|
|
Loading…
Reference in a new issue