setup: fix windows path buffer over-stepping
[git/debian.git] / t / t9010-svn-fe.sh
blob6dafe7e99ab4bd0006ed4f7204062fca31750689
1 #!/bin/sh
3 test_description='check svn dumpfile importer'
5 . ./test-lib.sh
7 reinit_git () {
8 if ! test_declared_prereq PIPE
9 then
10 echo >&4 "reinit_git: need to declare PIPE prerequisite"
11 return 127
13 rm -fr .git &&
14 rm -f stream backflow &&
15 git init &&
16 mkfifo stream backflow
19 try_dump () {
20 input=$1 &&
21 maybe_fail_svnfe=${2:+test_$2} &&
22 maybe_fail_fi=${3:+test_$3} &&
25 $maybe_fail_svnfe test-svn-fe "$input" >stream 3<backflow &
26 } &&
27 $maybe_fail_fi git fast-import --cat-blob-fd=3 <stream 3>backflow &&
28 wait $!
31 properties () {
32 while test "$#" -ne 0
34 property="$1" &&
35 value="$2" &&
36 printf "%s\n" "K ${#property}" &&
37 printf "%s\n" "$property" &&
38 printf "%s\n" "V ${#value}" &&
39 printf "%s\n" "$value" &&
40 shift 2 ||
41 return 1
42 done
45 text_no_props () {
46 text="$1
47 " &&
48 printf "%s\n" "Prop-content-length: 10" &&
49 printf "%s\n" "Text-content-length: ${#text}" &&
50 printf "%s\n" "Content-length: $((${#text} + 10))" &&
51 printf "%s\n" "" "PROPS-END" &&
52 printf "%s\n" "$text"
55 >empty
57 test_expect_success PIPE 'empty dump' '
58 reinit_git &&
59 echo "SVN-fs-dump-format-version: 2" >input &&
60 try_dump input
63 test_expect_success PIPE 'v4 dumps not supported' '
64 reinit_git &&
65 echo "SVN-fs-dump-format-version: 4" >v4.dump &&
66 try_dump v4.dump must_fail
69 test_expect_failure PIPE 'empty revision' '
70 reinit_git &&
71 printf "rev <nobody, nobody@local>: %s\n" "" "" >expect &&
72 cat >emptyrev.dump <<-\EOF &&
73 SVN-fs-dump-format-version: 3
75 Revision-number: 1
76 Prop-content-length: 0
77 Content-length: 0
79 Revision-number: 2
80 Prop-content-length: 0
81 Content-length: 0
83 EOF
84 try_dump emptyrev.dump &&
85 git log -p --format="rev <%an, %ae>: %s" HEAD >actual &&
86 test_cmp expect actual
89 test_expect_success PIPE 'empty properties' '
90 reinit_git &&
91 printf "rev <nobody, nobody@local>: %s\n" "" "" >expect &&
92 cat >emptyprop.dump <<-\EOF &&
93 SVN-fs-dump-format-version: 3
95 Revision-number: 1
96 Prop-content-length: 10
97 Content-length: 10
99 PROPS-END
101 Revision-number: 2
102 Prop-content-length: 10
103 Content-length: 10
105 PROPS-END
107 try_dump emptyprop.dump &&
108 git log -p --format="rev <%an, %ae>: %s" HEAD >actual &&
109 test_cmp expect actual
112 test_expect_success PIPE 'author name and commit message' '
113 reinit_git &&
114 echo "<author@example.com, author@example.com@local>" >expect.author &&
115 cat >message <<-\EOF &&
116 A concise summary of the change
118 A detailed description of the change, why it is needed, what
119 was broken and why applying this is the best course of action.
121 * file.c
122 Details pertaining to an individual file.
125 properties \
126 svn:author author@example.com \
127 svn:log "$(cat message)" &&
128 echo PROPS-END
129 } >props &&
131 echo "SVN-fs-dump-format-version: 3" &&
132 echo &&
133 echo "Revision-number: 1" &&
134 echo Prop-content-length: $(wc -c <props) &&
135 echo Content-length: $(wc -c <props) &&
136 echo &&
137 cat props
138 } >log.dump &&
139 try_dump log.dump &&
140 git log -p --format="%B" HEAD >actual.log &&
141 git log --format="<%an, %ae>" >actual.author &&
142 test_cmp message actual.log &&
143 test_cmp expect.author actual.author
146 test_expect_success PIPE 'unsupported properties are ignored' '
147 reinit_git &&
148 echo author >expect &&
149 cat >extraprop.dump <<-\EOF &&
150 SVN-fs-dump-format-version: 3
152 Revision-number: 1
153 Prop-content-length: 56
154 Content-length: 56
157 nonsense
160 K 10
161 svn:author
163 author
164 PROPS-END
166 try_dump extraprop.dump &&
167 git log -p --format=%an HEAD >actual &&
168 test_cmp expect actual
171 test_expect_failure PIPE 'timestamp and empty file' '
172 echo author@example.com >expect.author &&
173 echo 1999-01-01 >expect.date &&
174 echo file >expect.files &&
175 reinit_git &&
177 properties \
178 svn:author author@example.com \
179 svn:date "1999-01-01T00:01:002.000000Z" \
180 svn:log "add empty file" &&
181 echo PROPS-END
182 } >props &&
184 cat <<-EOF &&
185 SVN-fs-dump-format-version: 3
187 Revision-number: 1
189 echo Prop-content-length: $(wc -c <props) &&
190 echo Content-length: $(wc -c <props) &&
191 echo &&
192 cat props &&
193 cat <<-\EOF
195 Node-path: empty-file
196 Node-kind: file
197 Node-action: add
198 Content-length: 0
201 } >emptyfile.dump &&
202 try_dump emptyfile.dump &&
203 git log --format=%an HEAD >actual.author &&
204 git log --date=short --format=%ad HEAD >actual.date &&
205 git ls-tree -r --name-only HEAD >actual.files &&
206 test_cmp expect.author actual.author &&
207 test_cmp expect.date actual.date &&
208 test_cmp expect.files actual.files &&
209 git checkout HEAD empty-file &&
210 test_cmp empty file
213 test_expect_success PIPE 'directory with files' '
214 reinit_git &&
215 printf "%s\n" directory/file1 directory/file2 >expect.files &&
216 echo hi >hi &&
217 echo hello >hello &&
219 properties \
220 svn:author author@example.com \
221 svn:date "1999-02-01T00:01:002.000000Z" \
222 svn:log "add directory with some files in it" &&
223 echo PROPS-END
224 } >props &&
226 cat <<-EOF &&
227 SVN-fs-dump-format-version: 3
229 Revision-number: 1
231 echo Prop-content-length: $(wc -c <props) &&
232 echo Content-length: $(wc -c <props) &&
233 echo &&
234 cat props &&
235 cat <<-\EOF &&
237 Node-path: directory
238 Node-kind: dir
239 Node-action: add
240 Prop-content-length: 10
241 Content-length: 10
243 PROPS-END
245 Node-path: directory/file1
246 Node-kind: file
247 Node-action: add
249 text_no_props hello &&
250 cat <<-\EOF &&
251 Node-path: directory/file2
252 Node-kind: file
253 Node-action: add
255 text_no_props hi
256 } >directory.dump &&
257 try_dump directory.dump &&
259 git ls-tree -r --name-only HEAD >actual.files &&
260 git checkout HEAD directory &&
261 test_cmp expect.files actual.files &&
262 test_cmp hello directory/file1 &&
263 test_cmp hi directory/file2
266 test_expect_success PIPE 'branch name with backslash' '
267 reinit_git &&
268 sort <<-\EOF >expect.branch-files &&
269 trunk/file1
270 trunk/file2
271 "branches/UpdateFOPto094\\/file1"
272 "branches/UpdateFOPto094\\/file2"
275 echo hi >hi &&
276 echo hello >hello &&
278 properties \
279 svn:author author@example.com \
280 svn:date "1999-02-02T00:01:02.000000Z" \
281 svn:log "add directory with some files in it" &&
282 echo PROPS-END
283 } >props.setup &&
285 properties \
286 svn:author brancher@example.com \
287 svn:date "2007-12-06T21:38:34.000000Z" \
288 svn:log "Updating fop to .94 and adjust fo-stylesheets" &&
289 echo PROPS-END
290 } >props.branch &&
292 cat <<-EOF &&
293 SVN-fs-dump-format-version: 3
295 Revision-number: 1
297 echo Prop-content-length: $(wc -c <props.setup) &&
298 echo Content-length: $(wc -c <props.setup) &&
299 echo &&
300 cat props.setup &&
301 cat <<-\EOF &&
303 Node-path: trunk
304 Node-kind: dir
305 Node-action: add
306 Prop-content-length: 10
307 Content-length: 10
309 PROPS-END
311 Node-path: branches
312 Node-kind: dir
313 Node-action: add
314 Prop-content-length: 10
315 Content-length: 10
317 PROPS-END
319 Node-path: trunk/file1
320 Node-kind: file
321 Node-action: add
323 text_no_props hello &&
324 cat <<-\EOF &&
325 Node-path: trunk/file2
326 Node-kind: file
327 Node-action: add
329 text_no_props hi &&
330 cat <<-\EOF &&
332 Revision-number: 2
334 echo Prop-content-length: $(wc -c <props.branch) &&
335 echo Content-length: $(wc -c <props.branch) &&
336 echo &&
337 cat props.branch &&
338 cat <<-\EOF
340 Node-path: branches/UpdateFOPto094\
341 Node-kind: dir
342 Node-action: add
343 Node-copyfrom-rev: 1
344 Node-copyfrom-path: trunk
346 Node-kind: dir
347 Node-action: add
348 Prop-content-length: 34
349 Content-length: 34
351 K 13
352 svn:mergeinfo
355 PROPS-END
357 } >branch.dump &&
358 try_dump branch.dump &&
360 git ls-tree -r --name-only HEAD |
361 sort >actual.branch-files &&
362 test_cmp expect.branch-files actual.branch-files
365 test_expect_success PIPE 'node without action' '
366 reinit_git &&
367 cat >inaction.dump <<-\EOF &&
368 SVN-fs-dump-format-version: 3
370 Revision-number: 1
371 Prop-content-length: 10
372 Content-length: 10
374 PROPS-END
376 Node-path: directory
377 Node-kind: dir
378 Prop-content-length: 10
379 Content-length: 10
381 PROPS-END
383 try_dump inaction.dump must_fail
386 test_expect_success PIPE 'action: add node without text' '
387 reinit_git &&
388 cat >textless.dump <<-\EOF &&
389 SVN-fs-dump-format-version: 3
391 Revision-number: 1
392 Prop-content-length: 10
393 Content-length: 10
395 PROPS-END
397 Node-path: textless
398 Node-kind: file
399 Node-action: add
400 Prop-content-length: 10
401 Content-length: 10
403 PROPS-END
405 try_dump textless.dump must_fail
408 test_expect_failure PIPE 'change file mode but keep old content' '
409 reinit_git &&
410 cat >expect <<-\EOF &&
411 OBJID
412 :120000 100644 OBJID OBJID T greeting
413 OBJID
414 :100644 120000 OBJID OBJID T greeting
415 OBJID
416 :000000 100644 OBJID OBJID A greeting
418 echo "link hello" >expect.blob &&
419 echo hello >hello &&
420 cat >filemode.dump <<-\EOF &&
421 SVN-fs-dump-format-version: 3
423 Revision-number: 1
424 Prop-content-length: 10
425 Content-length: 10
427 PROPS-END
429 Node-path: greeting
430 Node-kind: file
431 Node-action: add
432 Prop-content-length: 10
433 Text-content-length: 11
434 Content-length: 21
436 PROPS-END
437 link hello
439 Revision-number: 2
440 Prop-content-length: 10
441 Content-length: 10
443 PROPS-END
445 Node-path: greeting
446 Node-kind: file
447 Node-action: change
448 Prop-content-length: 33
449 Content-length: 33
451 K 11
452 svn:special
455 PROPS-END
457 Revision-number: 3
458 Prop-content-length: 10
459 Content-length: 10
461 PROPS-END
463 Node-path: greeting
464 Node-kind: file
465 Node-action: change
466 Prop-content-length: 10
467 Content-length: 10
469 PROPS-END
471 try_dump filemode.dump &&
473 git rev-list HEAD |
474 git diff-tree --root --stdin |
475 sed "s/$_x40/OBJID/g"
476 } >actual &&
477 git show HEAD:greeting >actual.blob &&
478 git show HEAD^:greeting >actual.target &&
479 test_cmp expect actual &&
480 test_cmp expect.blob actual.blob &&
481 test_cmp hello actual.target
484 test_expect_success PIPE 'NUL in property value' '
485 reinit_git &&
486 echo "commit message" >expect.message &&
488 properties \
489 unimportant "something with a NUL (Q)" \
490 svn:log "commit message"&&
491 echo PROPS-END
493 q_to_nul >props &&
495 cat <<-\EOF &&
496 SVN-fs-dump-format-version: 3
498 Revision-number: 1
500 echo Prop-content-length: $(wc -c <props) &&
501 echo Content-length: $(wc -c <props) &&
502 echo &&
503 cat props
504 } >nulprop.dump &&
505 try_dump nulprop.dump &&
506 git diff-tree --always -s --format=%s HEAD >actual.message &&
507 test_cmp expect.message actual.message
510 test_expect_success PIPE 'NUL in log message, file content, and property name' '
511 # Caveat: svnadmin 1.6.16 (r1073529) truncates at \0 in the
512 # svn:specialQnotreally example.
513 reinit_git &&
514 cat >expect <<-\EOF &&
515 OBJID
516 :100644 100644 OBJID OBJID M greeting
517 OBJID
518 :000000 100644 OBJID OBJID A greeting
520 printf "\n%s\n" "something with an ASCII NUL (Q)" >expect.message &&
521 printf "%s\n" "helQo" >expect.hello1 &&
522 printf "%s\n" "link hello" >expect.hello2 &&
524 properties svn:log "something with an ASCII NUL (Q)" &&
525 echo PROPS-END
527 q_to_nul >props &&
529 q_to_nul <<-\EOF &&
530 SVN-fs-dump-format-version: 3
532 Revision-number: 1
533 Prop-content-length: 10
534 Content-length: 10
536 PROPS-END
538 Node-path: greeting
539 Node-kind: file
540 Node-action: add
541 Prop-content-length: 10
542 Text-content-length: 6
543 Content-length: 16
545 PROPS-END
546 helQo
548 Revision-number: 2
550 echo Prop-content-length: $(wc -c <props) &&
551 echo Content-length: $(wc -c <props) &&
552 echo &&
553 cat props &&
554 q_to_nul <<-\EOF
556 Node-path: greeting
557 Node-kind: file
558 Node-action: change
559 Prop-content-length: 43
560 Text-content-length: 11
561 Content-length: 54
563 K 21
564 svn:specialQnotreally
567 PROPS-END
568 link hello
570 } >8bitclean.dump &&
571 try_dump 8bitclean.dump &&
573 git rev-list HEAD |
574 git diff-tree --root --stdin |
575 sed "s/$_x40/OBJID/g"
576 } >actual &&
578 git cat-file commit HEAD | nul_to_q &&
579 echo
581 sed -ne "/^\$/,\$ p" >actual.message &&
582 git cat-file blob HEAD^:greeting | nul_to_q >actual.hello1 &&
583 git cat-file blob HEAD:greeting | nul_to_q >actual.hello2 &&
584 test_cmp expect actual &&
585 test_cmp expect.message actual.message &&
586 test_cmp expect.hello1 actual.hello1 &&
587 test_cmp expect.hello2 actual.hello2
590 test_expect_success PIPE 'change file mode and reiterate content' '
591 reinit_git &&
592 cat >expect <<-\EOF &&
593 OBJID
594 :120000 100644 OBJID OBJID T greeting
595 OBJID
596 :100644 120000 OBJID OBJID T greeting
597 OBJID
598 :000000 100644 OBJID OBJID A greeting
600 echo "link hello" >expect.blob &&
601 echo hello >hello &&
602 cat >filemode2.dump <<-\EOF &&
603 SVN-fs-dump-format-version: 3
605 Revision-number: 1
606 Prop-content-length: 10
607 Content-length: 10
609 PROPS-END
611 Node-path: greeting
612 Node-kind: file
613 Node-action: add
614 Prop-content-length: 10
615 Text-content-length: 11
616 Content-length: 21
618 PROPS-END
619 link hello
621 Revision-number: 2
622 Prop-content-length: 10
623 Content-length: 10
625 PROPS-END
627 Node-path: greeting
628 Node-kind: file
629 Node-action: change
630 Prop-content-length: 33
631 Text-content-length: 11
632 Content-length: 44
634 K 11
635 svn:special
638 PROPS-END
639 link hello
641 Revision-number: 3
642 Prop-content-length: 10
643 Content-length: 10
645 PROPS-END
647 Node-path: greeting
648 Node-kind: file
649 Node-action: change
650 Prop-content-length: 10
651 Text-content-length: 11
652 Content-length: 21
654 PROPS-END
655 link hello
657 try_dump filemode2.dump &&
659 git rev-list HEAD |
660 git diff-tree --root --stdin |
661 sed "s/$_x40/OBJID/g"
662 } >actual &&
663 git show HEAD:greeting >actual.blob &&
664 git show HEAD^:greeting >actual.target &&
665 test_cmp expect actual &&
666 test_cmp expect.blob actual.blob &&
667 test_cmp hello actual.target
670 test_expect_success PIPE 'deltas supported' '
671 reinit_git &&
673 # (old) h + (inline) ello + (old) \n
674 printf "SVNQ%b%b%s" "Q\003\006\005\004" "\001Q\0204\001\002" "ello" |
675 q_to_nul
676 } >delta &&
678 properties \
679 svn:author author@example.com \
680 svn:date "1999-01-05T00:01:002.000000Z" \
681 svn:log "add greeting" &&
682 echo PROPS-END
683 } >props &&
685 properties \
686 svn:author author@example.com \
687 svn:date "1999-01-06T00:01:002.000000Z" \
688 svn:log "change it" &&
689 echo PROPS-END
690 } >props2 &&
692 echo SVN-fs-dump-format-version: 3 &&
693 echo &&
694 echo Revision-number: 1 &&
695 echo Prop-content-length: $(wc -c <props) &&
696 echo Content-length: $(wc -c <props) &&
697 echo &&
698 cat props &&
699 cat <<-\EOF &&
701 Node-path: hello
702 Node-kind: file
703 Node-action: add
704 Prop-content-length: 10
705 Text-content-length: 3
706 Content-length: 13
708 PROPS-END
712 echo Revision-number: 2 &&
713 echo Prop-content-length: $(wc -c <props2) &&
714 echo Content-length: $(wc -c <props2) &&
715 echo &&
716 cat props2 &&
717 cat <<-\EOF &&
719 Node-path: hello
720 Node-kind: file
721 Node-action: change
722 Text-delta: true
723 Prop-content-length: 10
725 echo Text-content-length: $(wc -c <delta) &&
726 echo Content-length: $((10 + $(wc -c <delta))) &&
727 echo &&
728 echo PROPS-END &&
729 cat delta
730 } >delta.dump &&
731 try_dump delta.dump
734 test_expect_success PIPE 'property deltas supported' '
735 reinit_git &&
736 cat >expect <<-\EOF &&
737 OBJID
738 :100755 100644 OBJID OBJID M script.sh
741 properties \
742 svn:author author@example.com \
743 svn:date "1999-03-06T00:01:002.000000Z" \
744 svn:log "make an executable, or chmod -x it" &&
745 echo PROPS-END
746 } >revprops &&
748 echo SVN-fs-dump-format-version: 3 &&
749 echo &&
750 echo Revision-number: 1 &&
751 echo Prop-content-length: $(wc -c <revprops) &&
752 echo Content-length: $(wc -c <revprops) &&
753 echo &&
754 cat revprops &&
755 echo &&
756 cat <<-\EOF &&
757 Node-path: script.sh
758 Node-kind: file
759 Node-action: add
760 Text-content-length: 0
761 Prop-content-length: 39
762 Content-length: 39
764 K 14
765 svn:executable
767 true
768 PROPS-END
771 echo Revision-number: 2 &&
772 echo Prop-content-length: $(wc -c <revprops) &&
773 echo Content-length: $(wc -c <revprops) &&
774 echo &&
775 cat revprops &&
776 echo &&
777 cat <<-\EOF
778 Node-path: script.sh
779 Node-kind: file
780 Node-action: change
781 Prop-delta: true
782 Prop-content-length: 30
783 Content-length: 30
785 D 14
786 svn:executable
787 PROPS-END
789 } >propdelta.dump &&
790 try_dump propdelta.dump &&
792 git rev-list HEAD |
793 git diff-tree --stdin |
794 sed "s/$_x40/OBJID/g"
795 } >actual &&
796 test_cmp expect actual
799 test_expect_success PIPE 'properties on /' '
800 reinit_git &&
801 cat <<-\EOF >expect &&
802 OBJID
803 OBJID
804 :000000 100644 OBJID OBJID A greeting
806 sed -e "s/X$//" <<-\EOF >changeroot.dump &&
807 SVN-fs-dump-format-version: 3
809 Revision-number: 1
810 Prop-content-length: 10
811 Content-length: 10
813 PROPS-END
815 Node-path: greeting
816 Node-kind: file
817 Node-action: add
818 Text-content-length: 0
819 Prop-content-length: 10
820 Content-length: 10
822 PROPS-END
824 Revision-number: 2
825 Prop-content-length: 10
826 Content-length: 10
828 PROPS-END
830 Node-path: X
831 Node-kind: dir
832 Node-action: change
833 Prop-delta: true
834 Prop-content-length: 43
835 Content-length: 43
837 K 10
838 svn:ignore
839 V 11
840 build-area
842 PROPS-END
844 try_dump changeroot.dump &&
846 git rev-list HEAD |
847 git diff-tree --root --always --stdin |
848 sed "s/$_x40/OBJID/g"
849 } >actual &&
850 test_cmp expect actual
853 test_expect_success PIPE 'deltas for typechange' '
854 reinit_git &&
855 cat >expect <<-\EOF &&
856 OBJID
857 :120000 100644 OBJID OBJID T test-file
858 OBJID
859 :100755 120000 OBJID OBJID T test-file
860 OBJID
861 :000000 100755 OBJID OBJID A test-file
863 cat >deleteprop.dump <<-\EOF &&
864 SVN-fs-dump-format-version: 3
866 Revision-number: 1
867 Prop-content-length: 10
868 Content-length: 10
870 PROPS-END
872 Node-path: test-file
873 Node-kind: file
874 Node-action: add
875 Prop-delta: true
876 Prop-content-length: 35
877 Text-content-length: 17
878 Content-length: 52
880 K 14
881 svn:executable
884 PROPS-END
885 link testing 123
887 Revision-number: 2
888 Prop-content-length: 10
889 Content-length: 10
891 PROPS-END
893 Node-path: test-file
894 Node-kind: file
895 Node-action: change
896 Prop-delta: true
897 Prop-content-length: 53
898 Text-content-length: 17
899 Content-length: 70
901 K 11
902 svn:special
905 D 14
906 svn:executable
907 PROPS-END
908 link testing 231
910 Revision-number: 3
911 Prop-content-length: 10
912 Content-length: 10
914 PROPS-END
916 Node-path: test-file
917 Node-kind: file
918 Node-action: change
919 Prop-delta: true
920 Prop-content-length: 27
921 Text-content-length: 17
922 Content-length: 44
924 D 11
925 svn:special
926 PROPS-END
927 link testing 321
929 try_dump deleteprop.dump &&
931 git rev-list HEAD |
932 git diff-tree --root --stdin |
933 sed "s/$_x40/OBJID/g"
934 } >actual &&
935 test_cmp expect actual
938 test_expect_success PIPE 'deltas need not consume the whole preimage' '
939 reinit_git &&
940 cat >expect <<-\EOF &&
941 OBJID
942 :120000 100644 OBJID OBJID T postimage
943 OBJID
944 :100644 120000 OBJID OBJID T postimage
945 OBJID
946 :000000 100644 OBJID OBJID A postimage
948 echo "first preimage" >expect.1 &&
949 printf target >expect.2 &&
950 printf lnk >expect.3 &&
952 printf "SVNQ%b%b%b" "QQ\017\001\017" "\0217" "first preimage\n" |
953 q_to_nul
954 } >delta.1 &&
956 properties svn:special "*" &&
957 echo PROPS-END
958 } >symlink.props &&
960 printf "SVNQ%b%b%b" "Q\002\013\004\012" "\0201\001\001\0211" "lnk target" |
961 q_to_nul
962 } >delta.2 &&
964 printf "SVNQ%b%b" "Q\004\003\004Q" "\001Q\002\002" |
965 q_to_nul
966 } >delta.3 &&
968 cat <<-\EOF &&
969 SVN-fs-dump-format-version: 3
971 Revision-number: 1
972 Prop-content-length: 10
973 Content-length: 10
975 PROPS-END
977 Node-path: postimage
978 Node-kind: file
979 Node-action: add
980 Text-delta: true
981 Prop-content-length: 10
983 echo Text-content-length: $(wc -c <delta.1) &&
984 echo Content-length: $((10 + $(wc -c <delta.1))) &&
985 echo &&
986 echo PROPS-END &&
987 cat delta.1 &&
988 cat <<-\EOF &&
990 Revision-number: 2
991 Prop-content-length: 10
992 Content-length: 10
994 PROPS-END
996 Node-path: postimage
997 Node-kind: file
998 Node-action: change
999 Text-delta: true
1001 echo Prop-content-length: $(wc -c <symlink.props) &&
1002 echo Text-content-length: $(wc -c <delta.2) &&
1003 echo Content-length: $(($(wc -c <symlink.props) + $(wc -c <delta.2))) &&
1004 echo &&
1005 cat symlink.props &&
1006 cat delta.2 &&
1007 cat <<-\EOF &&
1009 Revision-number: 3
1010 Prop-content-length: 10
1011 Content-length: 10
1013 PROPS-END
1015 Node-path: postimage
1016 Node-kind: file
1017 Node-action: change
1018 Text-delta: true
1019 Prop-content-length: 10
1021 echo Text-content-length: $(wc -c <delta.3) &&
1022 echo Content-length: $((10 + $(wc -c <delta.3))) &&
1023 echo &&
1024 echo PROPS-END &&
1025 cat delta.3 &&
1026 echo
1027 } >deltapartial.dump &&
1028 try_dump deltapartial.dump &&
1030 git rev-list HEAD |
1031 git diff-tree --root --stdin |
1032 sed "s/$_x40/OBJID/g"
1033 } >actual &&
1034 test_cmp expect actual &&
1035 git show HEAD:postimage >actual.3 &&
1036 git show HEAD^:postimage >actual.2 &&
1037 git show HEAD^^:postimage >actual.1 &&
1038 test_cmp expect.1 actual.1 &&
1039 test_cmp expect.2 actual.2 &&
1040 test_cmp expect.3 actual.3
1043 test_expect_success PIPE 'no hang for delta trying to read past end of preimage' '
1044 reinit_git &&
1046 # COPY 1
1047 printf "SVNQ%b%b" "Q\001\001\002Q" "\001Q" |
1048 q_to_nul
1049 } >greedy.delta &&
1051 cat <<-\EOF &&
1052 SVN-fs-dump-format-version: 3
1054 Revision-number: 1
1055 Prop-content-length: 10
1056 Content-length: 10
1058 PROPS-END
1060 Node-path: bootstrap
1061 Node-kind: file
1062 Node-action: add
1063 Text-delta: true
1064 Prop-content-length: 10
1066 echo Text-content-length: $(wc -c <greedy.delta) &&
1067 echo Content-length: $((10 + $(wc -c <greedy.delta))) &&
1068 echo &&
1069 echo PROPS-END &&
1070 cat greedy.delta &&
1071 echo
1072 } >greedydelta.dump &&
1073 try_dump greedydelta.dump must_fail might_fail
1076 test_expect_success 'set up svn repo' '
1077 svnconf=$PWD/svnconf &&
1078 mkdir -p "$svnconf" &&
1081 svnadmin -h >/dev/null 2>&1 &&
1082 svnadmin create simple-svn &&
1083 svnadmin load simple-svn <"$TEST_DIRECTORY/t9135/svn.dump" &&
1084 svn export --config-dir "$svnconf" "file://$PWD/simple-svn" simple-svnco
1085 then
1086 test_set_prereq SVNREPO
1090 test_expect_success SVNREPO,PIPE 't9135/svn.dump' '
1091 mkdir -p simple-git &&
1093 cd simple-git &&
1094 reinit_git &&
1095 try_dump "$TEST_DIRECTORY/t9135/svn.dump"
1096 ) &&
1098 cd simple-svnco &&
1099 git init &&
1100 git add . &&
1101 git fetch ../simple-git master &&
1102 git diff --exit-code FETCH_HEAD
1106 test_done