summaryrefslogtreecommitdiff
path: root/diff_test.go
AgeCommit message (Collapse)Author
2020-12-05Refactor all callbacks (#700)lhchavez
This change is a preparation for another change that makes all callback types return a Go error instead of an error code / an integer. That is going to make make things a lot more idiomatic. The reason this change is split is threefold: a) This change is mostly mechanical and should contain no semantic changes. b) This change is backwards-compatible (in the Go API compatibility sense of the word), and thus can be backported to all other releases. c) It makes the other change a bit smaller and more focused on just one thing. Concretely, this change makes all callbacks populate a Go error when they fail. If the callback is invoked from the same stack as the function to which it was passed (e.g. for `Tree.Walk`), it will preserve the error object directly into a struct that also holds the callback function. Otherwise if the callback is pased to one func and will be invoked when run from another one (e.g. for `Repository.InitRebase`), the error string is saved into the libgit2 thread-local storage and then re-created as a `GitError`.
2020-12-05Mark some symbols to be deprecated #minor (#698)lhchavez
This change introduces the file deprecated.go, which contains any constants, functions, and types that are slated to be deprecated in the next major release. These symbols are deprecated because they refer to old spellings in pre-1.0 libgit2. This also makes the build be done with the `-DDEPRECATE_HARD` flag to avoid regressions. This, together with [gorelease](https://godoc.org/golang.org/x/exp/cmd/gorelease)[1] should make releases safer going forward. 1: More information about how that works at https://go.googlesource.com/exp/+/refs/heads/master/apidiff/README.md
2020-10-23apply: Add bindings for git_apply_to_tree (#657)Sami Hiltunen
Adds bindings to the git_apply_to_tree function that allows applying a diff directly to a tree.
2020-10-22Make `TestApplyDiffAddFile()` explicitly `.Free()` stuff (#661)lhchavez
This change adds explicit `.Free()` calls in `TestApplyDiffAddFile()`. It was discovered in #657 that some objects were not explicitly being freed, so this fixes that!
2020-08-18More diff functionality (#629)michael boulton
This PR adds - The ability to apply a Diff object to the repo - Support for git_apply_hunk_cb and git_apply_delta_cb callbacks in options for applying the diffs - The ability to import a diff from a raw buffer (for example, one exported by ToBuf) into a Diff object associated with the repo - Tests for the above
2016-08-27Run the tests in parallelCarlos Martín Nieto
This saves about 1s, or 1/3 of the test runtime. The linking is still much slower, but this we can control.
2015-06-29Add DiffBlobsCarlos Martín Nieto
This lets you diff two arbitrary blobs with arbitrary names.
2015-04-24tests: always clean up temporary repository dirsPatrick Steinhardt
Some test repositories are not correctly removed after the tests did run. Fix by introducing a function that is to be used for cleaning up temporary test repositories.
2015-01-04Add git_diff_get_stats()Henning Perl
This commit adds git_diff_get_stats() as well as functions to query the stats for insertions, deletions, and changed files.
2014-12-30heed DiffOptions fields OldPrefix and NewPrefixQuinn Slack
2014-11-26Integrated git_diff_find_similarJochen Hilgers
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-20refactor and cleanup codeJesse Ezell
2014-03-20cleanup and refactor diff / patchJesse Ezell