summaryrefslogtreecommitdiff
path: root/src/xdiff
Commit message (Collapse)AuthorAgeFilesLines
* leaks: call `xdl_free_classifier`Edward Thomson2016-03-311-1/+1
|
* xdiff/xprepare: fix a memory leakPatrick Steinhardt2016-03-311-0/+1
| | | | | | | | | | | | | | | The xdl_prepare_env() function may initialise an xdlclassifier_t data structure via xdl_init_classifier(), which allocates memory to several fields, for example 'rchash', 'rcrecs' and 'ncha'. If this function later exits due to the failure of xdl_optimize_ctxs(), then this xdlclassifier_t structure, and the memory allocated to it, is not cleaned up. In order to fix the memory leak, insert a call to xdl_free_classifier() before returning. This patch was originally written by Ramsay Jones (see commit 87f16258367a3b9a62663b11f898a4a6f3c19d31 in git.git).
* xdiff/xprepare: use the XDF_DIFF_ALG() macro to access flag bitsPatrick Steinhardt2016-03-311-1/+1
| | | | | | | | | | | | | | Commit 307ab20b3 ("xdiff: PATIENCE/HISTOGRAM are not independent option bits", 19-02-2012) introduced the XDF_DIFF_ALG() macro to access the flag bits used to represent the diff algorithm requested. In addition, code which had used explicit manipulation of the flag bits was changed to use the macros. However, one example of direct manipulation remains. Update this code to use the XDF_DIFF_ALG() macro. This patch was originally written by Ramsay Jones (see commit 5cd6978a9cfef58de061a9525f3678ade479564d in git.git).
* xdiff: fix memleak on error casePatrick Steinhardt2016-03-011-2/+5
| | | | | | | | | | | Commit 3d1abc5afce fixes a memory leak in the xdiff code. In the process of upstreaming the fix it was pointed out by Johannes Schindelin that there is another memory leak present (see [1]). Fix the second memory leak by applying the upstream fix to our code base. [1]: http://thread.gmane.org/gmane.comp.version-control.git/287034
* xmerge: fix memory leak on error pathPatrick Steinhardt2016-02-231-0/+2
|
* xdiff: reference util.h in parent directoryEdward Thomson2015-10-221-1/+1
| | | | | | Although CMake will correctly configure include directories for us, some people may use their own build system, and we should reference `util.h` based on where it actually lives.
* merge_file: treat large files as binaryEdward Thomson2015-10-051-3/+5
| | | | | | | | xdiff craps the bed on large files. Treat very large files as binary, so that it doesn't even have to try. Refactor our merge binary handling to better match git.git, which looks for a NUL in the first 8000 bytes.
* xdiff: convert size variables to size_tEdward Thomson2015-10-053-50/+110
|
* xdiff: cleanup some warningsEdward Thomson2015-07-102-1/+3
|
* xdiff: upgrade to core git 2.4.5Edward Thomson2015-07-0711-61/+127
| | | | | | | | | | | | | Upgrade xdiff to version used in core git 2.4.5 (0df0541). Corrects an issue where an LF is added at EOF while applying an unrelated change (ba31180), cleans up some unused code (be89977 and e5b0662), and provides an improved callback to avoid leaking internal (to xdiff) structures (467d348). This also adds some additional functionality that we do not yet take advantage of, namely the ability to ignore changes whose lines are all blank (36617af).
* Spelling fixesWill Stamper2014-12-042-2/+2
|
* Merge branch 'new-error-handling' into developmentVicent Martí2012-05-023-7/+7
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .travis.yml include/git2/diff.h src/config_file.c src/diff.c src/diff_output.c src/mwindow.c src/path.c tests-clar/clar_helpers.c tests-clar/object/tree/frompath.c tests/t00-core.c tests/t03-objwrite.c tests/t08-tag.c tests/t10-refs.c tests/t12-repo.c tests/t18-status.c tests/test_helpers.c tests/test_main.c
| * Fix warnings on 64-bit windows buildsRussell Belfer2012-04-173-7/+7
| | | | | | | | | | This fixes all the warnings on win64 except those in deps, which come from the regex code.
* | Check for _WIN32 instead of GIT_WIN32 or WIN32 to detect windows build ↵Sven Strickroth2012-04-211-1/+1
| | | | | | | | | | | | | | | | environments This fixes a possible compilation issue (when GIT_WIN32 was not set) which was introduced in revision 69a4bc1988fc242bd0d310781c865cce5481a0e6. Signed-off-by: Sven Strickroth <email@cs-ware.de>
* | WIN32 is not always defined, use GIT_WIN32 insteadSven Strickroth2012-04-201-1/+1
|/ | | | Signed-off-by: Sven Strickroth <email@cs-ware.de>
* Update diff to use iteratorsRussell Belfer2012-03-021-2/+2
| | | | | | | | | | | | | This is a major reorganization of the diff code. This changes the diff functions to use the iterators for traversing the content. This allowed a lot of code to be simplified. Also, this moved the functions relating to outputting a diff into a new file (diff_output.c). This includes a number of other changes - adding utility functions, extending iterators, etc. plus more tests for the diff code. This also takes the example diff.c program much further in terms of emulating git-diff command line options.
* Initial implementation of git_diff_blobRussell Belfer2012-03-021-1/+5
| | | | | | | | This gets the basic plumbing in place for git_diff_blob. There is a known issue where additional parameters like the number of lines of context to display on the diff are not working correctly (which leads one of the new unit tests to fail).
* Eliminate xdiff compiler warningsRussell Belfer2012-03-024-13/+26
| | | | | This cleans up the various GCC compiler warnings with the xdiff code that was copied in.
* Import xdiff library from gitRussell Belfer2012-03-0215-0/+3542
This is the initial import of the xdiff code (LGPL) from core git as of rev f349b562086e2b7595d8a977d2734ab2ef9e71ef