diff options
author | Russell Belfer <rb@github.com> | 2012-06-08 11:56:24 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-06-08 12:11:13 -0700 |
commit | 145e696b498a046762e4df9045c9b71440308486 (patch) | |
tree | b37682dece97e69e2be1056d656dc8d6fc5d3155 /tests-clar/diff/tree.c | |
parent | 0abd724454078f2089701b54be94df7306dcfb8e (diff) | |
download | libgit2-145e696b498a046762e4df9045c9b71440308486.tar.gz |
Minor fixes, cleanups, and clarifications
There are three actual changes in this commit:
1. When the trailing newline of a file is removed in a diff, the
change will now be reported with `GIT_DIFF_LINE_DEL_EOFNL` passed
to the callback. Previously, the `ADD_EOFNL` constant was given
which was just an error in my understanding of when the various
circumstances arose. `GIT_DIFF_LINE_ADD_EOFNL` is deprecated and
should never be generated. A new newline is simply an `ADD`.
2. Rewrote the `diff_delta__merge_like_cgit` function that contains
the core logic of the `git_diff_merge` implementation. The new
version doesn't actually have significantly different behavior,
but the logic should be much more obvious, I think.
3. Fixed a bug in `git_diff_merge` where it freed a string pool
while some of the string data was still in use. This led to
`git_diff_print_patch` accessing memory that had been freed.
The rest of this commit contains improved documentation in `diff.h`
to make the behavior and the equivalencies with core git clearer,
and a bunch of new tests to cover the various cases, oh and a minor
simplification of `examples/diff.c`.
Diffstat (limited to 'tests-clar/diff/tree.c')
-rw-r--r-- | tests-clar/diff/tree.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tests-clar/diff/tree.c b/tests-clar/diff/tree.c index b932fa10e..4201ad2a7 100644 --- a/tests-clar/diff/tree.c +++ b/tests-clar/diff/tree.c @@ -116,7 +116,7 @@ void test_diff_tree__options(void) { 5, 3, 0, 2, 0, 0, 0, 4, 0, 0, 51, 2, 46, 3 }, { 5, 3, 0, 2, 0, 0, 0, 4, 0, 0, 53, 4, 46, 3 }, { 5, 0, 3, 2, 0, 0, 0, 4, 0, 0, 52, 3, 3, 46 }, - { 5, 3, 0, 2, 0, 0, 0, 5, 0, 0, 54, 3, 48, 3 }, + { 5, 3, 0, 2, 0, 0, 0, 5, 0, 0, 54, 3, 47, 4 }, /* c vs d tests */ { 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 22, 9, 10, 3 }, { 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 19, 12, 7, 0 }, |