{"modulePath":"github.com/speakeasy-api/git-diff-parser","version":"v0.2.0","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package git_diff_parser\n\n## Constants\n\n```go\nconst (\n\tContentChangeTypeAdd    = contentChangeTypeAdd\n\tContentChangeTypeDelete = contentChangeTypeDelete\n\tContentChangeTypeModify = contentChangeTypeModify\n\tContentChangeTypeNOOP   = contentChangeTypeNOOP\n\n\tFileDiffTypeAdded    = fileDiffTypeAdded\n\tFileDiffTypeDeleted  = fileDiffTypeDeleted\n\tFileDiffTypeModified = fileDiffTypeModified\n)\n```\n\n## Variables\n\n```go\nvar ErrPatchConflict = errors.New(\"patch conflict\")\n```\n\n## Functions\n\n```go\nfunc ApplyFile(pristine, patchData []byte) ([]byte, error)\n```\n\n```go\nfunc ApplyFileWithConflicts(pristine, patchData []byte) ([]byte, error)\n```\n\n```go\nfunc ApplyPatchOperations(tree map[string][]byte, operations []PatchOperation) (map[string][]byte, error)\n```\nApplyPatchOperations applies ordered patch operations to a copy of tree.\n\n```go\nfunc ApplyPatchset(tree map[string][]byte, patchData []byte) (map[string][]byte, error)\n```\n\n```go\nfunc SignificantChange(diff string, isSignificant func(*FileDiff, *ContentChange) (bool, string)) (significant bool, msg string, err error)\n```\n\n## Types\n\n```go\ntype ContentChange = contentChange\n```\n\n```go\ntype ContentChangeType = contentChangeType\n```\n\n```go\ntype FileDiff = fileDiff\n```\n\n```go\ntype FileDiffType = fileDiffType\n```\n\n```go\ntype PatchOperation struct {\n\tType       PatchOperationType\n\tSourcePath string\n\tTargetPath string\n\tOldMode    string\n\tNewMode    string\n\tIndexMode  string\n\tIsBinary   bool\n\tPatch      []byte\n\t// contains filtered or unexported fields\n}\n```\nPatchOperation describes one file-level operation in a git patchset.\n\nValues returned by ParsePatchOperations can be passed to ApplyPatchOperations.\n\n```go\nfunc ParsePatchOperations(patchData []byte) ([]PatchOperation, error)\n```\nParsePatchOperations parses patchData into ordered file-level operations.\n\n```go\nfunc (op *PatchOperation) MutatesFileSet() bool\n```\nMutatesFileSet reports whether this operation adds, removes, or moves a file.\n\n```go\ntype PatchOperationType string\n```\n\n```go\nconst (\n\tPatchOperationTypeModify     PatchOperationType = \"modify\"\n\tPatchOperationTypeCreate     PatchOperationType = \"create\"\n\tPatchOperationTypeDelete     PatchOperationType = \"delete\"\n\tPatchOperationTypeRename     PatchOperationType = \"rename\"\n\tPatchOperationTypeCopy       PatchOperationType = \"copy\"\n\tPatchOperationTypeModeChange PatchOperationType = \"mode_change\"\n\tPatchOperationTypeBinary     PatchOperationType = \"binary\"\n)\n```\n\n","path":"github.com/speakeasy-api/git-diff-parser","name":"git_diff_parser","synopsis":"","isRedistributable":true}
