libgit2/tests/diff
Guille -bisho- e4b2b919bb Fix binary diffs
git expects an empty line after the binary data:

literal X
...binary data...
<empty_line>

The last literal block of the generated patches were not containing the required empty line. Example:

	diff --git a/binary_file b/binary_file
	index 3f1b3f9098131cfecea4a50ff8afab349ea66d22..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644
	GIT binary patch
	literal 8
	Pc${NM&PdElPvrst3ey5{

	literal 6
	Nc${NM%g@i}0ssZ|0lokL
	diff --git a/binary_file2 b/binary_file2
	index 31be99be19470da4af5b28b21e27896a2f2f9ee2..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644
	GIT binary patch
	literal 8
	Pc${NM&PdElPvrst3ey5{

	literal 13
	Sc${NMEKbZyOexL+Qd|HZV+4u-

git apply of that diff results in:

	error: corrupt binary patch at line 9: diff --git a/binary_file2 b/binary_file2
	fatal: patch with only garbage at line 10

The proper formating is:

	diff --git a/binary_file b/binary_file
	index 3f1b3f9098131cfecea4a50ff8afab349ea66d22..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644
	GIT binary patch
	literal 8
	Pc${NM&PdElPvrst3ey5{

	literal 6
	Nc${NM%g@i}0ssZ|0lokL
	diff --git a/binary_file2 b/binary_file2
	index 31be99be19470da4af5b28b21e27896a2f2f9ee2..86e5c1008b5ce635d3e3fffa4434c5eccd8f00b6 100644
	GIT binary patch
	literal 8
	Pc${NM&PdElPvrst3ey5{

	literal 13
	Sc${NMEKbZyOexL+Qd|HZV+4u-
2015-09-25 10:37:41 -07:00
..
binary.c Fix binary diffs 2015-09-25 10:37:41 -07:00
blob.c test-diff-blob: Pass proper nibble sizes 2015-06-26 16:52:26 +02:00
diff_helpers.c Fixed Xcode 6.1 build warnings 2015-06-15 09:55:12 -07:00
diff_helpers.h diff: introduce binary diff callbacks 2015-06-12 09:39:20 -04:00
diffiter.c Drop git_patch_to_str 2014-01-22 17:51:32 +01:00
drivers.c diff: don't error out on an invalid regex 2015-08-15 18:46:38 +02:00
format_email.c Use git_diff_get_stats in example/diff + refactor 2014-04-22 12:33:27 -07:00
index.c Added git_diff_index_to_index() 2015-06-30 10:03:32 -07:00
iterator.c iterator: use an options struct instead of args 2015-08-28 18:39:47 -04:00
notify.c diff: introduce binary diff callbacks 2015-06-12 09:39:20 -04:00
patch.c patch: emit binary patches (optionally) 2014-04-22 19:08:21 -05:00
pathspec.c Rename tests-clar to tests 2013-11-14 14:05:52 -08:00
rename.c diff: introduce binary diff callbacks 2015-06-12 09:39:20 -04:00
stats.c Don't scale diff stat when not needed 2014-05-12 10:28:45 -07:00
submodules.c submodule: make set_ignore() affect the configuration 2015-06-22 17:02:55 +02:00
tree.c Rename FALLBACK to UNSPECIFIED 2015-06-25 12:48:44 +02:00
workdir.c diff::workdir: ensure ignored files are not returned 2015-09-12 13:46:22 -04:00