summaryrefslogtreecommitdiff
path: root/diff.go
AgeCommit message (Collapse)Author
2014-04-04use cast_ptr instead of ptr for travis go tip buildJesse Ezell
2014-03-26fix go 1.0 compile errorJesse Ezell
2014-03-21don't expose 3 different diff foreach methods. use structures instead of ↵Jesse Ezell
pointers to structures for diff detail. add patch error code handling. trim excess data from diff structures.
2014-03-21Allow diff.ForEach to enumerate files, hunks, and lines with single call. ↵Jesse Ezell
Support use of closures for enumeration.
2014-03-20set ptr to nil after freeJesse Ezell
2014-03-20refactor and cleanup codeJesse Ezell
2014-03-20cleanup and refactor diff / patchJesse Ezell
2014-02-26Actually type constants; unwrap DiffFile, DiffDelta, DiffHunk.lye
2014-02-26Bundle consts more idiomatically; add GitLineType alias.lye
2014-02-26Unwrap DiffLine; add types for git_diff_flag_t and git_delta_t.lye
2014-02-23Pre-emptively copy data when marshalling diff callback data.lye
When marshalling diff callback data to Go structs, any `char*` need to be pre-emptively copied onto Go's heap as they're invalidated as soon as our callback function returns. This patch adds this extra copy before sending the value to the channel, which fixes a bug wherein `DiffLine.Content`, `DiffFile.Path` and `DiffHunk.Header` would previously return garbage data.
2014-02-23Export the constants and enumerations for diffs.lye
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.
2014-02-20Add partial diff/patch functionality.lye
This commit adds barebones capacity to generate diffs from two trees and to emit those as git-style diffs (via `Patch.String`), or to enumerate the files/hunks/lines in the diff to emit the data yourself. The walk functions have been implemented in the same manner as the Odb walking methods. Note that not all of the functionality is implemented for either the `git_diff_*` nor the `git_patch_*` functions, and there are unexposed constants which would likely be useful to add.