libgit2/tests/diff
Russell Belfer 8d09efa24e Use git_diff_get_stats in example/diff + refactor
This takes the `--stat` and related example options in the example
diff.c program and converts them to use the `git_diff_get_stats`
API which nicely formats stats for you.

I went to add bar-graph scaling to the stats formatter and noticed
that the `git_diff_stats` structure was holding on to all of the
`git_patch` objects.  Unfortunately, each of these objects keeps
the full text of the diff in memory, so this is very expensive.  I
ended up modifying `git_diff_stats` to keep just the data that it
needs to keep and allowed it to release the patches.  Then, I added
width scaling to the output on top of that.

In making the diff example program match 'git diff' output, I ended
up removing an newline from the sumamry output which I then had to
compensate for in the email formatting to match the expectations.

Lastly, I went through and refactored the tests to use a couple of
helper functions and reduce the overall amount of code there.
2014-04-22 12:33:27 -07:00
..
blob.c Add buffer to buffer diff and patch APIs 2014-02-27 14:13:22 -08:00
diff_helpers.c Add public diff print helpers 2014-04-17 14:43:45 -07:00
diff_helpers.h Rename tests-clar to tests 2013-11-14 14:05:52 -08:00
diffiter.c Drop git_patch_to_str 2014-01-22 17:51:32 +01:00
drivers.c Update Javascript userdiff driver and tests 2014-01-27 11:45:06 -08:00
format_email.c Use git_diff_get_stats in example/diff + refactor 2014-04-22 12:33:27 -07:00
index.c Remove converting user error to GIT_EUSER 2013-12-11 10:57:49 -08:00
iterator.c Index locking and entry allocation changes 2014-04-17 14:43:45 -07:00
notify.c More improvements to callback return value tests 2013-12-11 11:55:00 -08:00
patch.c Drop git_patch_to_str 2014-01-22 17:51:32 +01:00
pathspec.c Rename tests-clar to tests 2013-11-14 14:05:52 -08:00
rename.c git_checkout_opts -> git_checkout_options 2014-03-06 09:44:51 -08:00
stats.c Use git_diff_get_stats in example/diff + refactor 2014-04-22 12:33:27 -07:00
submodules.c Remove most submodule reloads from tests 2014-04-01 13:24:06 -07:00
tree.c Rename tests-clar to tests 2013-11-14 14:05:52 -08:00
workdir.c Update behavior for untracked sub-repos 2014-03-25 12:37:05 -07:00