mirror of
https://git.proxmox.com/git/libgit2
synced 2025-12-30 09:44:42 +00:00
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-
|
||
|---|---|---|
| .. | ||
| attr | ||
| blame | ||
| buf | ||
| checkout | ||
| cherrypick | ||
| clar | ||
| clone | ||
| commit | ||
| config | ||
| core | ||
| date | ||
| describe | ||
| diff | ||
| fetchhead | ||
| filter | ||
| graph | ||
| index | ||
| merge | ||
| network | ||
| notes | ||
| object | ||
| odb | ||
| online | ||
| pack | ||
| path | ||
| perf | ||
| rebase | ||
| refs | ||
| remote | ||
| repo | ||
| reset | ||
| resources | ||
| revert | ||
| revwalk | ||
| stash | ||
| status | ||
| stress | ||
| submodule | ||
| threads | ||
| trace | ||
| transport | ||
| win32 | ||
| clar_libgit2_timer.c | ||
| clar_libgit2_timer.h | ||
| clar_libgit2_trace.c | ||
| clar_libgit2_trace.h | ||
| clar_libgit2.c | ||
| clar_libgit2.h | ||
| clar.c | ||
| clar.h | ||
| generate_crlf.sh | ||
| generate.py | ||
| main.c | ||
| README.md | ||
| valgrind-supp-mac.txt | ||
Writing Clar tests for libgit2
For information on the Clar testing framework and a detailed introduction please visit:
-
Write your modules and tests. Use good, meaningful names.
-
Make sure you actually build the tests by setting:
cmake -DBUILD_CLAR=ON build/ -
Test:
./build/libgit2_clar -
Make sure everything is fine.
-
Send your pull request. That's it.