Skip to content

Commit

Permalink
fixes #148568
Browse files Browse the repository at this point in the history
  • Loading branch information
joaomoreno committed Jul 3, 2022
1 parent 5ab9f86 commit 98bd349
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extensions/git/src/git.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1785,12 +1785,12 @@ export class Repository {
} catch (err) {
if (/^error: failed to push some refs to\b/m.test(err.stderr || '')) {
err.gitErrorCode = GitErrorCodes.PushRejected;
} else if (/Permission.*denied/.test(err.stderr || '')) {
err.gitErrorCode = GitErrorCodes.PermissionDenied;
} else if (/Could not read from remote repository/.test(err.stderr || '')) {
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;
Expand Down

0 comments on commit 98bd349

Please sign in to comment.