Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export async function lfsAttributeMismatchHandler(
error: Error,
dispatcher: Dispatcher
): Promise {
const gitError = asGitError(error)
if (!gitError) {
return error
}
const dugiteError = gitError.result.gitError
if (!dugiteError) {
return error
}
if (dugiteError !== DugiteError.LFSAttributeDoesNotMatch) {
return error
}
dispatcher.showPopup({ type: PopupType.LFSAttributeMismatch })
return null
}
return 'This branch is protected from force-push operations.'
case DugiteError.ProtectedBranchRequiresReview:
return 'This branch is protected and any changes requires an approved review. Open a pull request with changes targeting this branch instead.'
case DugiteError.PushWithFileSizeExceedingLimit:
return "The push operation includes a file which exceeds GitHub's file size restriction of 100MB. Please remove the file from history and try again."
case DugiteError.HexBranchNameRejected:
return 'The branch name cannot be a 40-character string of hexadecimal characters, as this is the format that Git uses for representing objects.'
case DugiteError.ForcePushRejected:
return 'The force push has been rejected for the current branch.'
case DugiteError.InvalidRefLength:
return 'A ref cannot be longer than 255 characters.'
case DugiteError.CannotMergeUnrelatedHistories:
return 'Unable to merge unrelated histories in this repository.'
case DugiteError.PushWithPrivateEmail:
return 'Cannot push these commits as they contain an email address marked as private on GitHub.'
case DugiteError.LFSAttributeDoesNotMatch:
return 'Git LFS attribute found in global Git configuration does not match expected value.'
case DugiteError.ProtectedBranchDeleteRejected:
return 'This branch cannot be deleted from the remote repository because it is marked as protected.'
case DugiteError.ProtectedBranchRequiredStatus:
return 'The push was rejected by the remote server because a required status check has not been satisfied.'
case DugiteError.BranchRenameFailed:
return 'The branch could not be renamed.'
case DugiteError.PathDoesNotExist:
return 'The path does not exist on disk.'
case DugiteError.InvalidObjectName:
return 'The object was not found in the Git repository.'
case DugiteError.OutsideRepository:
return 'This path is not a valid path inside the repository.'
case DugiteError.LockFileAlreadyExists:
return 'A lock file already exists in the repository, which blocks this operation from completing.'
case DugiteError.NoMergeToAbort: