git: PushErrorHandler

This commit is contained in:
João Moreno
2020-07-15 15:52:31 +02:00
parent 8b531a2246
commit 1ab3137674
6 changed files with 72 additions and 8 deletions

View File

@@ -1627,6 +1627,8 @@ export class Repository {
err.gitErrorCode = GitErrorCodes.RemoteConnectionError;
} else if (/^fatal: The current branch .* has no upstream branch/.test(err.stderr || '')) {
err.gitErrorCode = GitErrorCodes.NoUpstreamBranch;
} else if (/Permission.*denied/.test(err.stderr || '')) {
err.gitErrorCode = GitErrorCodes.PermissionDenied;
}
throw err;