Skip to content

Commit

Permalink
Update git-model to match dugite-no-gpl
Browse files Browse the repository at this point in the history
Upstream dugite has changed its GitError enum [1], which became part
of `dugite-no-gpl` after its uplift. @theia/git has it own GitError enum [2],
that I believe needs to be aligned with `dugite's`.

This commit atttempts to align our version of that enum. After this update,
the @theia/git unit tests now pass.

[1] https://github.com/theia-ide/dugite/blob/main/lib/errors.ts#L2-L63
   starting at index 16 a new item was inserted, offsetting from that point.
   New entries were also added towards the end, offsetting the GitHub errors.
   finally new entries were added after the GitHub section.
[2] https://github.com/eclipse-theia/theia/blob/86fe42854196b1c3cea90b95840acae3e0f00061/packages/git/src/common/git-model.ts#L421-L467

Signed-off-by: Marc Dumais <marc.dumais@ericsson.com>
  • Loading branch information
marcdumais-work committed Nov 2, 2022
1 parent c69b77a commit d109bc9
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 35 deletions.
71 changes: 43 additions & 28 deletions packages/git/src/common/git-model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -435,35 +435,50 @@ export enum GitError {
RevertConflicts = 13,
EmptyRebasePatch = 14,
NoMatchingRemoteBranch = 15,
NothingToCommit = 16,
NoSubmoduleMapping = 17,
SubmoduleRepositoryDoesNotExist = 18,
InvalidSubmoduleSHA = 19,
LocalPermissionDenied = 20,
InvalidMerge = 21,
InvalidRebase = 22,
NonFastForwardMergeIntoEmptyHead = 23,
PatchDoesNotApply = 24,
BranchAlreadyExists = 25,
BadRevision = 26,
NotAGitRepository = 27,
CannotMergeUnrelatedHistories = 28,
LFSAttributeDoesNotMatch = 29,
BranchRenameFailed = 30,
PathDoesNotExist = 31,
InvalidObjectName = 32,
OutsideRepository = 33,
LockFileAlreadyExists = 34,
NoExistingRemoteBranch = 16,
NothingToCommit = 17,
NoSubmoduleMapping = 18,
SubmoduleRepositoryDoesNotExist = 19,
InvalidSubmoduleSHA = 20,
LocalPermissionDenied = 21,
InvalidMerge = 22,
InvalidRebase = 23,
NonFastForwardMergeIntoEmptyHead = 24,
PatchDoesNotApply = 25,
BranchAlreadyExists = 26,
BadRevision = 27,
NotAGitRepository = 28,
CannotMergeUnrelatedHistories = 29,
LFSAttributeDoesNotMatch = 30,
BranchRenameFailed = 31,
PathDoesNotExist = 32,
InvalidObjectName = 33,
OutsideRepository = 34,
LockFileAlreadyExists = 35,
NoMergeToAbort = 36,
LocalChangesOverwritten = 37,
UnresolvedConflicts = 38,
GPGFailedToSignData = 39,
ConflictModifyDeletedInBranch = 40,
// GitHub-specific error codes
PushWithFileSizeExceedingLimit = 35,
HexBranchNameRejected = 36,
ForcePushRejected = 37,
InvalidRefLength = 38,
ProtectedBranchRequiresReview = 39,
ProtectedBranchForcePush = 40,
ProtectedBranchDeleteRejected = 41,
ProtectedBranchRequiredStatus = 42,
PushWithPrivateEmail = 43
PushWithFileSizeExceedingLimit = 41,
HexBranchNameRejected = 42,
ForcePushRejected = 43,
InvalidRefLength = 44,
ProtectedBranchRequiresReview = 45,
ProtectedBranchForcePush = 46,
ProtectedBranchDeleteRejected = 47,
ProtectedBranchRequiredStatus = 48,
PushWithPrivateEmail = 49,
// End of GitHub-specific error codes
ConfigLockFileAlreadyExists = 50,
RemoteAlreadyExists = 51,
TagAlreadyExists = 52,
MergeWithLocalChanges = 53,
RebaseWithLocalChanges = 54,
MergeCommitNoMainlineOption = 55,
UnsafeDirectory = 56,
PathExistsButNotInRef = 57
}

export interface GitFileBlame {
Expand Down
7 changes: 0 additions & 7 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -4139,13 +4139,6 @@ check-error@^1.0.2:
resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82"
integrity sha512-BrgHpW9NURQgzoNyjfq0Wu6VFO6D7IZEmJNdtgNqpzGG8RuNFHt2jQxWlAs4HMe119chBnv+34syEZtc6IhLtA==

checksum@^0.1.1:
version "0.1.1"
resolved "https://registry.yarnpkg.com/checksum/-/checksum-0.1.1.tgz#dc6527d4c90be8560dbd1ed4cecf3297d528e9e9"
integrity sha512-xWkkJpoWQ6CptWw2GvtoQbScL3xtvGjoqvHpALE7B0tSHxSw0ex0tlsKOKkbETaOYGBhMliAyscestDyAZIN9g==
dependencies:
optimist "~0.3.5"

chokidar@3.5.3, chokidar@^3.5.1:
version "3.5.3"
resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.3.tgz#1cf37c8707b932bd1af1ae22c0432e2acd1903bd"
Expand Down

0 comments on commit d109bc9

Please sign in to comment.