Skip to content

Commit

Permalink
Merge pull request #433 from desktop/fail-to-sign-error
Browse files Browse the repository at this point in the history
Parse error when GPG fails to sign data
  • Loading branch information
sergiou87 committed Mar 23, 2021
2 parents db88e8d + 10ffcc4 commit 5ba161c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/errors.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export enum GitError {
NoMergeToAbort,
LocalChangesOverwritten,
UnresolvedConflicts,
GPGFailedToSignData,
// Start of GitHub-specific error codes
PushWithFileSizeExceedingLimit,
HexBranchNameRejected,
Expand Down Expand Up @@ -119,6 +120,7 @@ export const GitErrorRegexes: { [regexp: string]: GitError } = {
GitError.LocalChangesOverwritten,
'You must edit all merge conflicts and then\nmark them as resolved using git add|fatal: Exiting because of an unresolved conflict':
GitError.UnresolvedConflicts,
'error: gpg failed to sign the data': GitError.GPGFailedToSignData,
// GitHub-specific errors
'error: GH001: ': GitError.PushWithFileSizeExceedingLimit,
'error: GH002: ': GitError.HexBranchNameRejected,
Expand Down
9 changes: 9 additions & 0 deletions test/fast/git-process-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -424,6 +424,15 @@ mark them as resolved using git add`
expect(error).toBe(GitError.UnresolvedConflicts)
})

it('can parse the failed to sign data error within a rebase', () => {
const stderr = `Rebasing (1/4)
Rebasing (2/4)
error: gpg failed to sign the data`

const error = GitProcess.parseError(stderr)
expect(error).toBe(GitError.GPGFailedToSignData)
})

it('can parse the could not resolve host error', () => {
const stderr = `"Cloning into '/cloneablepath/'...\nfatal: unable to access 'https://github.com/Daniel-McCarthy/dugite.git/': Could not resolve host: github.com\n"`

Expand Down

0 comments on commit 5ba161c

Please sign in to comment.