summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlye <lye@>2014-02-23 18:04:55 -0600
committerlye <lye@>2014-02-23 18:06:04 -0600
commit375168abdc4cfad66d75786e31ee758bc5e374b7 (patch)
treed8a0e6e0a65400bcdd10332c632fbad4a8ed0230
parentbc80beb8432091bdf1190ad6b803060324802685 (diff)
Export the constants and enumerations for diffs.
It is possible that the typed enums from libgit2 should be exported as distinct types rather than numeric constants (e.g, `git_delta_t` and `git_line_t` should be typed), but this has not been done in this patch.
-rw-r--r--diff.go27
1 files changed, 27 insertions, 0 deletions
diff --git a/diff.go b/diff.go
index d9570c9..11493e1 100644
--- a/diff.go
+++ b/diff.go
@@ -11,6 +11,33 @@ import (
"unsafe"
)
+const (
+ DiffFlagBinary = C.GIT_DIFF_FLAG_BINARY
+ DiffFlagNotBinary = C.GIT_DIFF_FLAG_NOT_BINARY
+ DiffFlagValidOid = C.GIT_DIFF_FLAG_VALID_OID
+
+ DeltaUnmodified = C.GIT_DELTA_UNMODIFIED
+ DeltaAdded = C.GIT_DELTA_ADDED
+ DeltaDeleted = C.GIT_DELTA_DELETED
+ DeltaModified = C.GIT_DELTA_MODIFIED
+ DeltaRenamed = C.GIT_DELTA_RENAMED
+ DeltaCopied = C.GIT_DELTA_COPIED
+ DeltaIgnored = C.GIT_DELTA_IGNORED
+ DeltaUntracked = C.GIT_DELTA_UNTRACKED
+ DeltaTypeChange = C.GIT_DELTA_TYPECHANGE
+
+ DiffLineContext = C.GIT_DIFF_LINE_CONTEXT
+ DiffLineAddition = C.GIT_DIFF_LINE_ADDITION
+ DiffLineDeletion = C.GIT_DIFF_LINE_DELETION
+ DiffLineContextEOFNL = C.GIT_DIFF_LINE_CONTEXT_EOFNL
+ DiffLineAddEOFNL = C.GIT_DIFF_LINE_ADD_EOFNL
+ DiffLineDelEOFNL = C.GIT_DIFF_LINE_DEL_EOFNL
+
+ DiffLineFileHdr = C.GIT_DIFF_LINE_FILE_HDR
+ DiffLineHunkHdr = C.GIT_DIFF_LINE_HUNK_HDR
+ DiffLineBinary = C.GIT_DIFF_LINE_BINARY
+)
+
type DiffFile struct {
file C.git_diff_file
}