未验证 提交 0cdd4b12 编写于 作者: J João Moreno 提交者: GitHub

Merge pull request #64619 from Microsoft/rmacfarlane/git-apply

Add GitErrorCode to apply command
......@@ -214,4 +214,5 @@ export const enum GitErrorCodes {
WrongCase = 'WrongCase',
CantLockRef = 'CantLockRef',
CantRebaseMultipleBranches = 'CantRebaseMultipleBranches',
PatchDoesNotApply = 'PatchDoesNotApply'
}
\ No newline at end of file
......@@ -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> {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册