summaryrefslogtreecommitdiff
path: root/tests-clar/diff/patch.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix MSVC compilation warningsnulltoken2013-02-051-3/+3
| | | | Fix #1308
* Free buffer at end of testRussell Belfer2013-01-301-0/+2
|
* Add helper for diff line statsRussell Belfer2013-01-301-0/+65
| | | | | | | | | | | | This adds a `git_diff_patch_line_stats()` API that gets the total number of adds, deletes, and context lines in a patch. This will make it a little easier to emulate `git diff --stat` and the like. Right now, this relies on generating the `git_diff_patch` object, which is a pretty heavyweight way to get stat information. At some future point, it would probably be nice to be able to get this information without allocating the entire `git_diff_patch`, but that's a much larger project.
* Fix diff patch line number calculationRussell Belfer2013-01-111-1/+109
| | | | | | | | This was just wrong. Added a test that verifying patch line numbers even for hunks further into a file and then fixed the algorithm. I needed to add a little extra state into the patch so that I could track old and new file numbers independently, but it should be okay.
* Fix warnings on Win64 buildRussell Belfer2012-11-271-1/+1
|
* Update diff callback param orderRussell Belfer2012-11-271-4/+4
| | | | | | | | This makes the diff functions that take callbacks both take the payload parameter after the callback function pointers and pass the payload as the last argument to the callback function instead of the first. This should make them consistent with other callbacks across the API.
* Fix diff API to better parameter orderRussell Belfer2012-11-141-2/+2
| | | | | The diff API is not in the parameter order one would expect from other libgit2 APIs. This fixes that.
* Add git_diff_patch_to_str APIRussell Belfer2012-10-241-0/+30
| | | | | This adds an API to generate a complete single-file patch text from a git_diff_patch object.
* Add const to all shared pointers in diff APIRussell Belfer2012-09-251-2/+2
| | | | | | | | | | There are a lot of places where the diff API gives the user access to internal data structures and many of these were being exposed through non-const pointers. This replaces them all with const pointers for any object that the user can access but is still owned internally to the git_diff_list or git_diff_patch objects. This will probably break some bindings... Sorry!
* Fix usage of "new" for fieldname in public headerRussell Belfer2012-05-021-2/+2
| | | | | | | | This should restore the ability to include libgit2 headers in C++ projects. Cherry picked 2de60205dfea2c4a422b2108a5e8605f97c2e895 from development into new-error-handling.
* tests-clar/diff: mark output_len unusedMichael Schubert2012-05-011-0/+1
|
* diff: provide more context to the consumer of the callbacksnulltoken2012-04-301-7/+37
| | | | Update the callback to provide some information related to the file change being processed and the range of the hunk, when applicable.
* diff: fix generation of the header of a removal patchnulltoken2012-04-251-0/+68