summaryrefslogtreecommitdiff
path: root/tests/diff/stats.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #5494 from kevinjswinton/masterEdward Thomson2020-10-041-2/+1
|\ | | | | Fix binary diff showing /dev/null
| * Fix binary diff showing /dev/nullKevin Swinton2020-04-181-2/+1
| | | | | | | | | | | | Fixes issue where a changed binary file's content in the working tree isn't displayed correctly, instead showing an oid of zero, and with its path being reported incorrectly as "/dev/null".
* | diff stats: fix segfaults with new filesDrew DeVault2020-09-161-0/+35
|/
* diff_stats: use git's formatting of renames with common directoriesPatrick Steinhardt2018-10-041-1/+1
| | | | | | | | | | | In cases where a file gets renamed such that the directories containing it previous and after the rename have a common prefix, then git will avoid printing this prefix twice and instead format the rename as "prefix/{old => new}". We currently didn't do anything like that, but simply printed "prefix/old -> prefix/new". Adjust our behaviour to instead match upstream. Adjust the test for this behaviour to expect the new format.
* tests: verify diff stats with renames in subdirectoryPatrick Steinhardt2018-10-041-0/+19
| | | | | | | | | | | Until now, we didn't have any tests that verified that our format for renames in subdirectories is correct. While our current behaviour is no different than for renames that do not happen with a common prefix shared between old and new file name, we intend to change the format to instead match the format that upstream git uses. Add a test case for this to document our current behaviour and to show how the next commit will change that format.
* Convert usage of `git_buf_free` to new `git_buf_dispose`Patrick Steinhardt2018-06-101-16/+16
|
* typo: Fixed a trivial typo in test function.Erik van Zijst2018-04-051-1/+1
|
* Merge branch 'pr/3809'Edward Thomson2016-10-091-0/+36
|\
| * make git_diff_stats_to_buf not show 0 insertions or 0 deletionsSim Domingo2016-10-091-0/+36
| |
* | git_diff_generated: abstract generated diffsEdward Thomson2016-05-261-0/+1
|/
* Don't scale diff stat when not neededRussell Belfer2014-05-121-0/+4
|
* Use git_diff_get_stats in example/diff + refactorRussell Belfer2014-04-221-250/+107
| | | | | | | | | | | | | | | | | | | | | 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.
* Introduce git_diff_get_stats, git_diff_stats_files_changed, ↵Jacques Germishuys2014-04-151-0/+428
git_diff_stats_insertions, git_diff_stats_deletions and git_diff_stats_to_buf