]>
git.proxmox.com Git - libgit2.git/blob - tests/patch/patch_common.h
1e03889fcb776cb22a25ac310d542abe35656e0d
1 /* The original file contents */
3 #define FILE_ORIGINAL \
5 "this is some context!\n" \
6 "around some lines\n" \
9 "(this line is changed)\n" \
11 "is additional context\n" \
14 /* A change in the middle of the file (and the resultant patch) */
16 #define FILE_CHANGE_MIDDLE \
18 "this is some context!\n" \
19 "around some lines\n" \
20 "that will change\n" \
22 "(THIS line is changed!)\n" \
24 "is additional context\n" \
27 #define PATCH_ORIGINAL_TO_CHANGE_MIDDLE \
28 "diff --git a/file.txt b/file.txt\n" \
29 "index 9432026..cd8fd12 100644\n" \
32 "@@ -3,7 +3,7 @@ this is some context!\n" \
33 " around some lines\n" \
34 " that will change\n" \
36 "-(this line is changed)\n" \
37 "+(THIS line is changed!)\n" \
39 " is additional context\n" \
42 #define PATCH_ORIGINAL_TO_CHANGE_MIDDLE_NOCONTEXT \
43 "diff --git a/file.txt b/file.txt\n" \
44 "index 9432026..cd8fd12 100644\n" \
47 "@@ -6 +6 @@ yes it is!\n" \
48 "-(this line is changed)\n" \
49 "+(THIS line is changed!)\n"
51 /* A change of the first line (and the resultant patch) */
53 #define FILE_CHANGE_FIRSTLINE \
54 "hey, change in head!\n" \
55 "this is some context!\n" \
56 "around some lines\n" \
57 "that will change\n" \
59 "(this line is changed)\n" \
61 "is additional context\n" \
64 #define PATCH_ORIGINAL_TO_CHANGE_FIRSTLINE \
65 "diff --git a/file.txt b/file.txt\n" \
66 "index 9432026..c81df1d 100644\n" \
71 "+hey, change in head!\n" \
72 " this is some context!\n" \
73 " around some lines\n" \
76 /* A change of the last line (and the resultant patch) */
78 #define FILE_CHANGE_LASTLINE \
80 "this is some context!\n" \
81 "around some lines\n" \
82 "that will change\n" \
84 "(this line is changed)\n" \
86 "is additional context\n" \
87 "change to the last line.\n"
89 #define PATCH_ORIGINAL_TO_CHANGE_LASTLINE \
90 "diff --git a/file.txt b/file.txt\n" \
91 "index 9432026..f70db1c 100644\n" \
94 "@@ -6,4 +6,4 @@ yes it is!\n" \
95 " (this line is changed)\n" \
97 " is additional context\n" \
99 "+change to the last line.\n"
101 /* A change of the middle where we remove many lines */
103 #define FILE_CHANGE_MIDDLE_SHRINK \
105 "i've changed a lot, but left the line\n" \
108 #define PATCH_ORIGINAL_TO_CHANGE_MIDDLE_SHRINK \
109 "diff --git a/file.txt b/file.txt\n" \
110 "index 9432026..629cd35 100644\n" \
113 "@@ -1,9 +1,3 @@\n" \
115 "-this is some context!\n" \
116 "-around some lines\n" \
117 "-that will change\n" \
119 "-(this line is changed)\n" \
121 "-is additional context\n" \
122 "+i've changed a lot, but left the line\n" \
125 #define PATCH_ORIGINAL_TO_MIDDLE_SHRINK_NOCONTEXT \
126 "diff --git a/file.txt b/file.txt\n" \
127 "index 9432026..629cd35 100644\n" \
130 "@@ -2,7 +2 @@ hey!\n" \
131 "-this is some context!\n" \
132 "-around some lines\n" \
133 "-that will change\n" \
135 "-(this line is changed)\n" \
137 "-is additional context\n" \
138 "+i've changed a lot, but left the line\n"
140 /* A change to the middle where we grow many lines */
142 #define FILE_CHANGE_MIDDLE_GROW \
144 "this is some context!\n" \
145 "around some lines\n" \
146 "that will change\n" \
148 "this line is changed\n" \
149 "and this line is added\n" \
154 "is additional context\n" \
157 #define PATCH_ORIGINAL_TO_CHANGE_MIDDLE_GROW \
158 "diff --git a/file.txt b/file.txt\n" \
159 "index 9432026..207ebca 100644\n" \
162 "@@ -3,7 +3,11 @@ this is some context!\n" \
163 " around some lines\n" \
164 " that will change\n" \
166 "-(this line is changed)\n" \
167 "+this line is changed\n" \
168 "+and this line is added\n" \
173 " is additional context\n" \
177 #define PATCH_ORIGINAL_TO_MIDDLE_GROW_NOCONTEXT \
178 "diff --git a/file.txt b/file.txt\n" \
179 "index 9432026..207ebca 100644\n" \
182 "@@ -6 +6,5 @@ yes it is!\n" \
183 "-(this line is changed)\n" \
184 "+this line is changed\n" \
185 "+and this line is added\n" \
190 /* An insertion at the beginning of the file (and the resultant patch) */
192 #define FILE_PREPEND \
193 "insert at front\n" \
195 "this is some context!\n" \
196 "around some lines\n" \
197 "that will change\n" \
199 "(this line is changed)\n" \
201 "is additional context\n" \
204 #define PATCH_ORIGINAL_TO_PREPEND \
205 "diff --git a/file.txt b/file.txt\n" \
206 "index 9432026..0f39b9a 100644\n" \
209 "@@ -1,3 +1,4 @@\n" \
210 "+insert at front\n" \
212 " this is some context!\n" \
213 " around some lines\n"
215 #define PATCH_ORIGINAL_TO_PREPEND_NOCONTEXT \
216 "diff --git a/file.txt b/file.txt\n" \
217 "index 9432026..0f39b9a 100644\n" \
223 /* An insertion at the beginning of the file and change in the middle */
225 #define FILE_PREPEND_AND_CHANGE \
226 "insert at front\n" \
228 "this is some context!\n" \
229 "around some lines\n" \
230 "that will change\n" \
232 "(THIS line is changed!)\n" \
234 "is additional context\n" \
237 #define PATCH_ORIGINAL_TO_PREPEND_AND_CHANGE \
238 "diff --git a/file.txt b/file.txt\n" \
239 "index 9432026..f73c8bb 100644\n" \
242 "@@ -1,9 +1,10 @@\n" \
243 "+insert at front\n" \
245 " this is some context!\n" \
246 " around some lines\n" \
247 " that will change\n" \
249 "-(this line is changed)\n" \
250 "+(THIS line is changed!)\n" \
252 " is additional context\n" \
255 #define PATCH_ORIGINAL_TO_PREPEND_AND_CHANGE_NOCONTEXT \
256 "diff --git a/file.txt b/file.txt\n" \
257 "index 9432026..f73c8bb 100644\n" \
261 "+insert at front\n" \
262 "@@ -6 +7 @@ yes it is!\n" \
263 "-(this line is changed)\n" \
264 "+(THIS line is changed!)\n"
266 /* A change in the middle and a deletion of the newline at the end of the file */
268 #define FILE_CHANGE_MIDDLE_AND_LASTLINE \
270 "this is some context!\n" \
271 "around some lines\n" \
272 "that will change\n" \
274 "(THIS line is changed!)\n" \
276 "is additional context\n" \
277 "BELOW it! - (THIS line is changed!)"
279 #define PATCH_ORIGINAL_TO_CHANGE_MIDDLE_AND_LASTLINE_NOCONTEXT \
280 "diff --git a/file.txt b/file.txt\n" \
281 "index 9432026..e05d36c 100644\n" \
284 "@@ -6 +6 @@ yes it is!\n" \
285 "-(this line is changed)\n" \
286 "+(THIS line is changed!)\n" \
287 "@@ -9 +9 @@ is additional context\n" \
289 "+BELOW it! - (THIS line is changed!)\n" \
290 "\\ No newline at end of file\n"
292 /* A deletion at the beginning of the file and a change in the middle */
294 #define FILE_DELETE_AND_CHANGE \
295 "this is some context!\n" \
296 "around some lines\n" \
297 "that will change\n" \
299 "(THIS line is changed!)\n" \
301 "is additional context\n" \
304 #define PATCH_ORIGINAL_TO_DELETE_AND_CHANGE \
305 "diff --git a/file.txt b/file.txt\n" \
306 "index 9432026..1e2dfa6 100644\n" \
309 "@@ -1,9 +1,8 @@\n" \
311 " this is some context!\n" \
312 " around some lines\n" \
313 " that will change\n" \
315 "-(this line is changed)\n" \
316 "+(THIS line is changed!)\n" \
318 " is additional context\n" \
321 #define PATCH_ORIGINAL_TO_DELETE_AND_CHANGE_NOCONTEXT \
322 "diff --git a/file.txt b/file.txt\n" \
323 "index 9432026..1e2dfa6 100644\n" \
328 "@@ -6 +5 @@ yes it is!\n" \
329 "-(this line is changed)\n" \
330 "+(THIS line is changed!)\n"
332 /* A deletion at the beginning of the file */
334 #define FILE_DELETE_FIRSTLINE \
335 "this is some context!\n" \
336 "around some lines\n" \
337 "that will change\n" \
339 "(this line is changed)\n" \
341 "is additional context\n" \
344 #define PATCH_ORIGINAL_TO_DELETE_FIRSTLINE \
345 "diff --git a/file.txt b/file.txt\n" \
346 "index 9432026..f31fa13 100644\n" \
349 "@@ -1,4 +1,3 @@\n" \
351 " this is some context!\n" \
352 " around some lines\n" \
353 " that will change\n"
355 /* An insertion at the end of the file (and the resultant patch) */
357 #define FILE_APPEND \
359 "this is some context!\n" \
360 "around some lines\n" \
361 "that will change\n" \
363 "(this line is changed)\n" \
365 "is additional context\n" \
369 #define PATCH_ORIGINAL_TO_APPEND \
370 "diff --git a/file.txt b/file.txt\n" \
371 "index 9432026..72788bb 100644\n" \
374 "@@ -7,3 +7,4 @@ yes it is!\n" \
376 " is additional context\n" \
380 #define PATCH_ORIGINAL_TO_APPEND_NOCONTEXT \
381 "diff --git a/file.txt b/file.txt\n" \
382 "index 9432026..72788bb 100644\n" \
385 "@@ -9,0 +10 @@ below it!\n" \
388 #define PATCH_DELETED_FILE_2_HUNKS \
389 "diff --git a/a b/a\n" \
390 "index 7f129fd..af431f2 100644\n" \
396 "diff --git a/c/d b/c/d\n" \
397 "deleted file mode 100644\n" \
398 "index 297efb8..0000000\n" \
404 #define PATCH_DELETED_FILE_2_HUNKS_SHUFFLED \
405 "diff --git a/c/d b/c/d\n" \
406 "deleted file mode 100644\n" \
407 "index 297efb8..0000000\n" \
412 "diff --git a/a b/a\n" \
413 "index 7f129fd..af431f2 100644\n" \
420 #define PATCH_SIMPLE_COMMIT \
421 "commit 15e119375018fba121cf58e02a9f17fe22df0df8\n" \
422 "Author: Edward Thomson <ethomson@edwardthomson.com>\n" \
423 "Date: Wed Jun 14 13:31:20 2017 +0200\n" \
425 " CHANGELOG: document git_filter_init and GIT_FILTER_INIT\n" \
427 "diff --git a/CHANGELOG.md b/CHANGELOG.md\n" \
428 "index 1b9e0c90a..24ecba426 100644\n" \
429 "--- a/CHANGELOG.md\n" \
430 "+++ b/CHANGELOG.md\n" \
431 "@@ -96,6 +96,9 @@ v0.26\n" \
432 " * `git_transport_smart_proxy_options()' enables you to get the proxy options for\n" \
433 " smart transports.\n" \
435 "+* The `GIT_FILTER_INIT` macro and the `git_filter_init` function are provided\n" \
436 "+ to initialize a `git_filter` structure.\n" \
438 " ### Breaking API changes\n" \
440 " * `clone_checkout_strategy` has been removed from\n"
442 #define PATCH_MULTIPLE_HUNKS \
443 "diff --git a/x b/x\n" \
444 "index 0719398..fa0350c 100644\n" \
447 "@@ -1,5 +1,4 @@\n" \
453 "@@ -7,3 +6,4 @@\n" \
459 #define PATCH_MULTIPLE_FILES \
460 "diff --git a/x b/x\n" \
461 "index 8a1218a..7059ba5 100644\n" \
464 "@@ -1,5 +1,4 @@\n" \
470 "diff --git a/y b/y\n" \
471 "index e006065..9405325 100644\n" \
474 "@@ -1,4 +1,5 @@\n" \
481 #define FILE_PREPEND_AND_APPEND \
483 "this is some context!\n" \
484 "around some lines\n" \
485 "that will change\n" \
487 "(this line is changed)\n" \
489 "is additional context\n" \
492 #define PATCH_ORIGINAL_TO_PREPEND_AND_APPEND \
493 "diff --git a/file.txt b/file.txt\n" \
494 "index 9432026..f282430 100644\n" \
497 "@@ -1,4 +1,4 @@\n" \
500 " this is some context!\n" \
501 " around some lines\n" \
502 " that will change\n" \
503 "@@ -6,4 +6,4 @@ yes it is!\n" \
504 " (this line is changed)\n" \
506 " is additional context\n" \
510 #define PATCH_ORIGINAL_TO_EMPTY_FILE \
511 "diff --git a/file.txt b/file.txt\n" \
512 "index 9432026..e69de29 100644\n" \
515 "@@ -1,9 +0,0 @@\n" \
517 "-this is some context!\n" \
518 "-around some lines\n" \
519 "-that will change\n" \
521 "-(this line is changed)\n" \
523 "-is additional context\n" \
526 #define PATCH_EMPTY_FILE_TO_ORIGINAL \
527 "diff --git a/file.txt b/file.txt\n" \
528 "index e69de29..9432026 100644\n" \
531 "@@ -0,0 +1,9 @@\n" \
533 "+this is some context!\n" \
534 "+around some lines\n" \
535 "+that will change\n" \
537 "+(this line is changed)\n" \
539 "+is additional context\n" \
542 #define PATCH_ADD_ORIGINAL \
543 "diff --git a/file.txt b/file.txt\n" \
544 "new file mode 100644\n" \
545 "index 0000000..9432026\n" \
548 "@@ -0,0 +1,9 @@\n" \
550 "+this is some context!\n" \
551 "+around some lines\n" \
552 "+that will change\n" \
554 "+(this line is changed)\n" \
556 "+is additional context\n" \
559 #define PATCH_DELETE_ORIGINAL \
560 "diff --git a/file.txt b/file.txt\n" \
561 "deleted file mode 100644\n" \
562 "index 9432026..0000000\n" \
565 "@@ -1,9 +0,0 @@\n" \
567 "-this is some context!\n" \
568 "-around some lines\n" \
569 "-that will change\n" \
571 "-(this line is changed)\n" \
573 "-is additional context\n" \
576 #define PATCH_RENAME_EXACT \
577 "diff --git a/file.txt b/newfile.txt\n" \
578 "similarity index 100%\n" \
579 "rename from file.txt\n" \
580 "rename to newfile.txt\n"
582 #define PATCH_RENAME_EXACT_WITH_MODE \
583 "diff --git a/RENAMED.md b/README.md\n" \
584 "old mode 100644\n" \
585 "new mode 100755\n" \
586 "similarity index 100%\n" \
587 "rename from RENAMED.md\n" \
588 "rename to README.md\n"
590 #define PATCH_RENAME_SIMILAR \
591 "diff --git a/file.txt b/newfile.txt\n" \
592 "similarity index 77%\n" \
593 "rename from file.txt\n" \
594 "rename to newfile.txt\n" \
595 "index 9432026..cd8fd12 100644\n" \
597 "+++ b/newfile.txt\n" \
598 "@@ -3,7 +3,7 @@ this is some context!\n" \
599 " around some lines\n" \
600 " that will change\n" \
602 "-(this line is changed)\n" \
603 "+(THIS line is changed!)\n" \
605 " is additional context\n" \
608 #define PATCH_RENAME_EXACT_QUOTEDNAME \
609 "diff --git a/file.txt \"b/foo\\\"bar.txt\"\n" \
610 "similarity index 100%\n" \
611 "rename from file.txt\n" \
612 "rename to \"foo\\\"bar.txt\"\n"
614 #define PATCH_RENAME_SIMILAR_QUOTEDNAME \
615 "diff --git a/file.txt \"b/foo\\\"bar.txt\"\n" \
616 "similarity index 77%\n" \
617 "rename from file.txt\n" \
618 "rename to \"foo\\\"bar.txt\"\n" \
619 "index 9432026..cd8fd12 100644\n" \
621 "+++ \"b/foo\\\"bar.txt\"\n" \
622 "@@ -3,7 +3,7 @@ this is some context!\n" \
623 " around some lines\n" \
624 " that will change\n" \
626 "-(this line is changed)\n" \
627 "+(THIS line is changed!)\n" \
629 " is additional context\n" \
632 #define PATCH_MODECHANGE_UNCHANGED \
633 "diff --git a/file.txt b/file.txt\n" \
634 "old mode 100644\n" \
637 #define PATCH_MODECHANGE_MODIFIED \
638 "diff --git a/file.txt b/file.txt\n" \
639 "old mode 100644\n" \
640 "new mode 100755\n" \
641 "index 9432026..cd8fd12\n" \
644 "@@ -3,7 +3,7 @@ this is some context!\n" \
645 " around some lines\n" \
646 " that will change\n" \
648 "-(this line is changed)\n" \
649 "+(THIS line is changed!)\n" \
651 " is additional context\n" \
654 #define PATCH_NOISY \
655 "This is some\nleading noise\n@@ - that\nlooks like a hunk header\n" \
656 "but actually isn't and should parse ok\n" \
657 PATCH_ORIGINAL_TO_CHANGE_MIDDLE \
658 "plus some trailing garbage for good measure\n"
660 #define PATCH_NOISY_NOCONTEXT \
661 "This is some\nleading noise\n@@ - that\nlooks like a hunk header\n" \
662 "but actually isn't and should parse ok\n" \
663 PATCH_ORIGINAL_TO_CHANGE_MIDDLE_NOCONTEXT \
664 "plus some trailing garbage for good measure\n"
666 #define PATCH_TRUNCATED_1 \
667 "diff --git a/file.txt b/file.txt\n" \
668 "index 9432026..cd8fd12 100644\n" \
671 "@@ -3,7 +3,7 @@ this is some context!\n" \
672 " around some lines\n" \
673 " that will change\n" \
675 "-(this line is changed)\n" \
676 "+(THIS line is changed!)\n" \
679 #define PATCH_TRUNCATED_2 \
680 "diff --git a/file.txt b/file.txt\n" \
681 "index 9432026..cd8fd12 100644\n" \
684 "@@ -3,7 +3,7 @@ this is some context!\n" \
685 " around some lines\n" \
686 "-(this line is changed)\n" \
687 "+(THIS line is changed!)\n" \
689 " is additional context\n" \
692 #define PATCH_TRUNCATED_3 \
693 "diff --git a/file.txt b/file.txt\n" \
694 "index 9432026..cd8fd12 100644\n" \
697 "@@ -3,7 +3,7 @@ this is some context!\n" \
698 " around some lines\n" \
699 " that will change\n" \
701 "+(THIS line is changed!)\n" \
703 " is additional context\n" \
706 #define FILE_EMPTY_CONTEXT_ORIGINAL \
707 "this\nhas\nan\n\nempty\ncontext\nline\n"
709 #define FILE_EMPTY_CONTEXT_MODIFIED \
710 "this\nhas\nan\n\nempty...\ncontext\nline\n"
712 #define PATCH_EMPTY_CONTEXT \
713 "diff --git a/file.txt b/file.txt\n" \
714 "index 398d2df..bb15234 100644\n" \
717 "@@ -2,6 +2,6 @@ this\n" \
726 #define FILE_APPEND_NO_NL \
728 "this is some context!\n" \
729 "around some lines\n" \
730 "that will change\n" \
732 "(this line is changed)\n" \
734 "is additional context\n" \
736 "added line with no nl"
738 #define PATCH_APPEND_NO_NL \
739 "diff --git a/file.txt b/file.txt\n" \
740 "index 9432026..83759c0 100644\n" \
743 "@@ -7,3 +7,4 @@ yes it is!\n" \
745 " is additional context\n" \
747 "+added line with no nl\n" \
748 "\\ No newline at end of file\n"
750 #define PATCH_APPEND_NO_NL_IN_OLD_FILE \
751 "diff --git a/file.txt b/file.txt\n" \
752 "index 9432026..83759c0 100644\n" \
755 "@@ -1,1 +1,1 @@\n" \
757 "\\ No newline at end of file\n" \
760 #define PATCH_NAME_WHITESPACE \
761 "diff --git a/file with spaces.txt b/file with spaces.txt\n" \
762 "index 9432026..83759c0 100644\n" \
763 "--- a/file with spaces.txt\n" \
764 "+++ b/file with spaces.txt\n" \
765 "@@ -0,3 +0,2 @@\n" \
767 "-is additional context\n" \
770 #define PATCH_CORRUPT_GIT_HEADER \
771 "diff --git a/file.txt\n" \
772 "index 9432026..0f39b9a 100644\n" \
778 #define PATCH_CORRUPT_MISSING_NEW_FILE \
779 "diff --git a/file.txt b/file.txt\n" \
780 "index 9432026..cd8fd12 100644\n" \
782 "@@ -6 +6 @@ yes it is!\n" \
783 "-(this line is changed)\n" \
784 "+(THIS line is changed!)\n"
786 #define PATCH_CORRUPT_MISSING_OLD_FILE \
787 "diff --git a/file.txt b/file.txt\n" \
788 "index 9432026..cd8fd12 100644\n" \
790 "@@ -6 +6 @@ yes it is!\n" \
791 "-(this line is changed)\n" \
792 "+(THIS line is changed!)\n"
794 #define PATCH_CORRUPT_NO_CHANGES \
795 "diff --git a/file.txt b/file.txt\n" \
796 "index 9432026..cd8fd12 100644\n" \
799 "@@ -0,0 +0,0 @@ yes it is!\n"
801 #define PATCH_CORRUPT_MISSING_HUNK_HEADER \
802 "diff --git a/file.txt b/file.txt\n" \
803 "index 9432026..cd8fd12 100644\n" \
806 "-(this line is changed)\n" \
807 "+(THIS line is changed!)\n"
809 #define PATCH_NOT_A_PATCH \
811 "--actually even\n" \
814 "-it's something else\n" \
817 /* binary contents */
819 #define FILE_BINARY_LITERAL_ORIGINAL "\x00\x00\x0a"
820 #define FILE_BINARY_LITERAL_ORIGINAL_LEN 3
822 #define FILE_BINARY_LITERAL_MODIFIED "\x00\x00\x01\x02\x0a"
823 #define FILE_BINARY_LITERAL_MODIFIED_LEN 5
825 #define PATCH_BINARY_LITERAL \
826 "diff --git a/binary.bin b/binary.bin\n" \
827 "index bd474b2519cc15eab801ff851cc7d50f0dee49a1..9ac35ff15cd8864aeafd889e4826a3150f0b06c4 100644\n" \
828 "GIT binary patch\n" \
830 "Mc${NkU}WL~000&M4gdfE\n" \
833 "Kc${Nk-~s>u4FC%O\n\n"
835 #define FILE_BINARY_DELTA_ORIGINAL \
836 "\x00\x00\x01\x02\x00\x00\x01\x02\x00\x00\x01\x02\x0a\x54\x68\x69" \
837 "\x73\x20\x69\x73\x20\x61\x20\x62\x69\x6e\x61\x72\x79\x20\x66\x69" \
838 "\x6c\x65\x2c\x20\x62\x79\x20\x76\x69\x72\x74\x75\x65\x20\x6f\x66" \
839 "\x20\x68\x61\x76\x69\x6e\x67\x20\x73\x6f\x6d\x65\x20\x6e\x75\x6c" \
840 "\x6c\x73\x2e\x0a\x00\x00\x01\x02\x00\x00\x01\x02\x00\x00\x01\x02" \
841 "\x0a\x57\x65\x27\x72\x65\x20\x67\x6f\x69\x6e\x67\x20\x74\x6f\x20" \
842 "\x63\x68\x61\x6e\x67\x65\x20\x70\x6f\x72\x74\x69\x6f\x6e\x73\x20" \
843 "\x6f\x66\x20\x69\x74\x2e\x0a\x00\x00\x01\x02\x00\x00\x01\x02\x00" \
844 "\x00\x01\x02\x0a\x53\x6f\x20\x74\x68\x61\x74\x20\x77\x65\x20\x67" \
845 "\x69\x74\x20\x61\x20\x62\x69\x6e\x61\x72\x79\x20\x64\x65\x6c\x74" \
846 "\x61\x20\x69\x6e\x73\x74\x65\x61\x64\x20\x6f\x66\x20\x74\x68\x65" \
847 "\x20\x64\x65\x66\x6c\x61\x74\x65\x64\x20\x63\x6f\x6e\x74\x65\x6e" \
848 "\x74\x73\x2e\x0a\x00\x00\x01\x02\x00\x00\x01\x02\x00\x00\x01\x02" \
850 #define FILE_BINARY_DELTA_ORIGINAL_LEN 209
852 #define FILE_BINARY_DELTA_MODIFIED \
853 "\x00\x00\x01\x02\x00\x00\x01\x02\x00\x00\x01\x02\x0a\x5a\x5a\x5a" \
854 "\x5a\x20\x69\x73\x20\x61\x20\x62\x69\x6e\x61\x72\x79\x20\x66\x69" \
855 "\x6c\x65\x2c\x20\x62\x79\x20\x76\x69\x72\x74\x75\x65\x20\x6f\x66" \
856 "\x20\x68\x61\x76\x69\x6e\x67\x20\x73\x6f\x6d\x65\x20\x6e\x75\x6c" \
857 "\x6c\x73\x2e\x0a\x00\x00\x01\x02\x00\x00\x01\x02\x00\x00\x01\x02" \
858 "\x0a\x57\x65\x27\x72\x65\x20\x67\x6f\x69\x6e\x67\x20\x74\x6f\x20" \
859 "\x63\x68\x61\x6e\x67\x65\x20\x70\x6f\x72\x74\x69\x6f\x6e\x73\x20" \
860 "\x6f\x66\x20\x49\x54\x2e\x0a\x00\x00\x01\x02\x00\x00\x01\x02\x00" \
861 "\x00\x01\x02\x0a\x53\x4f\x20\x74\x68\x61\x74\x20\x77\x65\x20\x67" \
862 "\x69\x74\x20\x61\x20\x62\x69\x6e\x61\x72\x79\x20\x64\x65\x6c\x74" \
863 "\x61\x20\x69\x6e\x73\x74\x65\x61\x64\x20\x6f\x66\x20\x74\x68\x65" \
864 "\x20\x64\x65\x66\x6c\x61\x74\x65\x64\x20\x63\x6f\x6e\x74\x65\x6e" \
865 "\x74\x73\x2e\x0a\x00\x00\x01\x02\x00\x00\x01\x02\x00\x00\x01\x02" \
867 #define FILE_BINARY_DELTA_MODIFIED_LEN 209
869 #define PATCH_BINARY_DELTA \
870 "diff --git a/binary.bin b/binary.bin\n" \
871 "index 27184d9883b12c4c9c54b4a31137603586169f51..7c94f9e60bf366033d98e0d551ae37d30faef74a 100644\n" \
872 "GIT binary patch\n" \
874 "kc$~Y)c#%<%fq{_;hPk4EV4`4>uxE%K7m7r%|HL+L0In7XGynhq\n" \
877 "mc$~Y)c#%<%fq{_;hPgsAGK(h)CJASj=y9P)1m{m|^9BI99|yz$\n\n"
879 #define PATCH_BINARY_ADD \
880 "diff --git a/binary.bin b/binary.bin\n" \
881 "new file mode 100644\n" \
882 "index 0000000000000000000000000000000000000000..7c94f9e60bf366033d98e0d551ae37d30faef74a\n" \
883 "GIT binary patch\n" \
885 "zc${60u?oUK5JXSQe8qG&;(u6KC<u0&+$Ohh?#kUJlD{_rLCL^0!@QXgcKh&k^H>C_\n" \
886 "zAhe=XX7rNzh<3&##YcwqNHmEKsP<&&m~%Zf;eX@Khr$?aExDmfqyyt+#l^I)3+LMg\n" \
887 "kxnAIj9Pfn_|Gh`fP7tlm6j#y{FJYg_IifRlR^R@A08f862mk;8\n" \
892 #define PATCH_BINARY_DELETE \
893 "diff --git a/binary.bin b/binary.bin\n" \
894 "deleted file mode 100644\n" \
895 "index 7c94f9e60bf366033d98e0d551ae37d30faef74a..0000000000000000000000000000000000000000\n" \
896 "GIT binary patch\n" \
901 "zc${60u?oUK5JXSQe8qG&;(u6KC<u0&+$Ohh?#kUJlD{_rLCL^0!@QXgcKh&k^H>C_\n" \
902 "zAhe=XX7rNzh<3&##YcwqNHmEKsP<&&m~%Zf;eX@Khr$?aExDmfqyyt+#l^I)3+LMg\n" \
903 "kxnAIj9Pfn_|Gh`fP7tlm6j#y{FJYg_IifRlR^R@A08f862mk;8\n\n"
905 /* contains an old side that does not match the expected source */
906 #define PATCH_BINARY_NOT_REVERSIBLE \
907 "diff --git a/binary.bin b/binary.bin\n" \
908 "index 27184d9883b12c4c9c54b4a31137603586169f51..7c94f9e60bf366033d98e0d551ae37d30faef74a 100644\n" \
909 "GIT binary patch\n" \
911 "Mc${NkU}WL~000&M4gdfE\n" \
914 "mc$~Y)c#%<%fq{_;hPgsAGK(h)CJASj=y9P)1m{m|^9BI99|yz$\n\n"
916 #define PATCH_BINARY_NOT_PRINTED \
917 "diff --git a/binary.bin b/binary.bin\n" \
918 "index 27184d9..7c94f9e 100644\n" \
919 "Binary files a/binary.bin and b/binary.bin differ\n"
921 #define PATCH_ADD_BINARY_NOT_PRINTED \
922 "diff --git a/test.bin b/test.bin\n" \
923 "new file mode 100644\n" \
924 "index 0000000..9e0f96a\n" \
925 "Binary files /dev/null and b/test.bin differ\n"
927 #define PATCH_ORIGINAL_NEW_FILE_WITH_SPACE \
928 "diff --git a/sp ace.txt b/sp ace.txt\n" \
929 "new file mode 100644\n" \
930 "index 000000000..789819226\n" \
932 "+++ b/sp ace.txt\n" \
937 "diff --git a/test-file b/test-file\r\n" \
938 "new file mode 100644\r\n" \
939 "index 0000000..af431f2 100644\r\n" \
940 "--- /dev/null\r\n" \
941 "+++ b/test-file\r\n" \
942 "@@ -0,0 +1 @@\r\n" \
945 #define PATCH_NO_EXTENDED_HEADERS \
946 "diff --git a/file b/file\n" \
949 "@@ -1,3 +1,3 @@\n" \
955 #define PATCH_BINARY_FILE_WITH_MISSING_PATHS \
961 #define PATCH_BINARY_FILE_WITH_WHITESPACE_PATHS \
962 "diff --git a/file b/file\n" \
967 #define PATCH_BINARY_FILE_WITH_QUOTED_EMPTY_PATHS \
968 "diff --git a/file b/file\n" \
973 #define PATCH_BINARY_FILE_PATH_WITH_SPACES \
974 "diff --git a b c d e f\n" \
977 "Binary files a b c and d e f differ"
979 #define PATCH_BINARY_FILE_PATH_WITHOUT_BODY_PATHS \
980 "diff --git a b c d e f\n" \
983 "Binary files a b c and d e f differ"
985 #define PATCH_BINARY_FILE_WITH_TRUNCATED_DELTA \
986 "diff --git a/file b/file\n" \
987 "index 1420..b71f\n" \
988 "GIT binary patch\n" \
992 #define PATCH_MULTIPLE_OLD_PATHS \
996 "index 0000..7DDb\n" \
999 #define PATCH_INTMAX_NEW_LINES \
1000 "diff --git a/file b/file\n" \
1003 "@@ -0 +2147483647 @@\n" \