Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add error code for UnresolvedConflicts (#306)
* add error code to detect when conflicts are unresolved

* add test for new error code
  • Loading branch information
shiftkey committed Feb 28, 2019
1 parent f5d761c commit fe0bf55
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/errors.ts
Expand Up @@ -38,6 +38,7 @@ export enum GitError {
LockFileAlreadyExists,
NoMergeToAbort,
LocalChangesOverwritten,
UnresolvedConflicts,
// GitHub-specific error codes
PushWithFileSizeExceedingLimit,
HexBranchNameRejected,
Expand Down Expand Up @@ -107,6 +108,8 @@ export const GitErrorRegexes = {
'fatal: There is no merge to abort': GitError.NoMergeToAbort,
'error: (?:Your local changes to the following|The following untracked working tree) files would be overwritten by checkout:':
GitError.LocalChangesOverwritten,
'You must edit all merge conflicts and then\nmark them as resolved using git add':
GitError.UnresolvedConflicts,
// 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
Expand Up @@ -414,5 +414,14 @@ remove the file manually to continue.`
error = GitProcess.parseError(stderr)
expect(error).toBe(GitError.LocalChangesOverwritten)
})

it('can parse the unresovled conflicts error', () => {
const stderr = `2-simple-rebase-conflict/LICENSE.md: needs merge
You must edit all merge conflicts and then
mark them as resolved using git add`

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

0 comments on commit fe0bf55

Please sign in to comment.