~ubuntu-branches/ubuntu/intrepid/git-core/intrepid-security

« back to all changes in this revision

Viewing changes to t/t9300-fast-import.sh

  • Committer: Package Import Robot
  • Author(s): Gerrit Pape
  • Date: 2007-10-04 08:27:01 UTC
  • mfrom: (1.1.23)
  • Revision ID: package-import@ubuntu.com-20071004082701-rsd058ontoqz4i30
Tags: 1:1.5.3.4-1
new upstream point release (closes: #445188).

Show diffs side-by-side

added added

removed removed

Lines of Context:
60
60
test_expect_success \
61
61
    'A: create pack from stdin' \
62
62
    'git-fast-import --export-marks=marks.out <input &&
63
 
         git-whatchanged master'
 
63
         git whatchanged master'
64
64
test_expect_success \
65
65
        'A: verify pack' \
66
 
        'for p in .git/objects/pack/*.pack;do git-verify-pack $p||exit;done'
 
66
        'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done'
67
67
 
68
68
cat >expect <<EOF
69
69
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
73
73
EOF
74
74
test_expect_success \
75
75
        'A: verify commit' \
76
 
        'git-cat-file commit master | sed 1d >actual &&
 
76
        'git cat-file commit master | sed 1d >actual &&
77
77
        git diff expect actual'
78
78
 
79
79
cat >expect <<EOF
83
83
EOF
84
84
test_expect_success \
85
85
        'A: verify tree' \
86
 
        'git-cat-file -p master^{tree} | sed "s/ [0-9a-f]*      / /" >actual &&
 
86
        'git cat-file -p master^{tree} | sed "s/ [0-9a-f]*      / /" >actual &&
87
87
         git diff expect actual'
88
88
 
89
89
echo "$file2_data" >expect
90
90
test_expect_success \
91
91
        'A: verify file2' \
92
 
        'git-cat-file blob master:file2 >actual && git diff expect actual'
 
92
        'git cat-file blob master:file2 >actual && git diff expect actual'
93
93
 
94
94
echo "$file3_data" >expect
95
95
test_expect_success \
96
96
        'A: verify file3' \
97
 
        'git-cat-file blob master:file3 >actual && git diff expect actual'
 
97
        'git cat-file blob master:file3 >actual && git diff expect actual'
98
98
 
99
99
printf "$file4_data" >expect
100
100
test_expect_success \
101
101
        'A: verify file4' \
102
 
        'git-cat-file blob master:file4 >actual && git diff expect actual'
 
102
        'git cat-file blob master:file4 >actual && git diff expect actual'
103
103
 
104
104
cat >expect <<EOF
105
 
:2 `git-rev-parse --verify master:file2`
106
 
:3 `git-rev-parse --verify master:file3`
107
 
:4 `git-rev-parse --verify master:file4`
108
 
:5 `git-rev-parse --verify master^0`
 
105
:2 `git rev-parse --verify master:file2`
 
106
:3 `git rev-parse --verify master:file3`
 
107
:4 `git rev-parse --verify master:file4`
 
108
:5 `git rev-parse --verify master^0`
109
109
EOF
110
110
test_expect_success \
111
111
        'A: verify marks output' \
134
134
test_expect_success \
135
135
        'A: verify marks import does not crash' \
136
136
        'git-fast-import --import-marks=marks.out <input &&
137
 
         git-whatchanged verify--import-marks'
 
137
         git whatchanged verify--import-marks'
138
138
test_expect_success \
139
139
        'A: verify pack' \
140
 
        'for p in .git/objects/pack/*.pack;do git-verify-pack $p||exit;done'
 
140
        'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done'
141
141
cat >expect <<EOF
142
142
:000000 100755 0000000000000000000000000000000000000000 7123f7f44e39be127c5eb701e5968176ee9d78b1 A      copy-of-file2
143
143
EOF
144
 
git-diff-tree -M -r master verify--import-marks >actual
 
144
git diff-tree -M -r master verify--import-marks >actual
145
145
test_expect_success \
146
146
        'A: verify diff' \
147
147
        'compare_diff_raw expect actual &&
148
 
         test `git-rev-parse --verify master:file2` \
149
 
            = `git-rev-parse --verify verify--import-marks:copy-of-file2`'
 
148
         test `git rev-parse --verify master:file2` \
 
149
            = `git rev-parse --verify verify--import-marks:copy-of-file2`'
150
150
 
151
151
###
152
152
### series B
170
170
    'git-fast-import <input'
171
171
rm -f .git/objects/pack_* .git/objects/index_*
172
172
 
 
173
cat >input <<INPUT_END
 
174
commit .badbranchname
 
175
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
176
data <<COMMIT
 
177
corrupt
 
178
COMMIT
 
179
 
 
180
from refs/heads/master
 
181
 
 
182
INPUT_END
 
183
test_expect_failure \
 
184
    'B: fail on invalid branch name ".badbranchname"' \
 
185
    'git-fast-import <input'
 
186
rm -f .git/objects/pack_* .git/objects/index_*
 
187
 
 
188
cat >input <<INPUT_END
 
189
commit bad[branch]name
 
190
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
191
data <<COMMIT
 
192
corrupt
 
193
COMMIT
 
194
 
 
195
from refs/heads/master
 
196
 
 
197
INPUT_END
 
198
test_expect_failure \
 
199
    'B: fail on invalid branch name "bad[branch]name"' \
 
200
    'git-fast-import <input'
 
201
rm -f .git/objects/pack_* .git/objects/index_*
 
202
 
 
203
cat >input <<INPUT_END
 
204
commit TEMP_TAG
 
205
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
206
data <<COMMIT
 
207
tag base
 
208
COMMIT
 
209
 
 
210
from refs/heads/master
 
211
 
 
212
INPUT_END
 
213
test_expect_success \
 
214
    'B: accept branch name "TEMP_TAG"' \
 
215
    'git-fast-import <input &&
 
216
         test -f .git/TEMP_TAG &&
 
217
         test `git rev-parse master` = `git rev-parse TEMP_TAG^`'
 
218
rm -f .git/TEMP_TAG
 
219
 
173
220
###
174
221
### series C
175
222
###
176
223
 
177
224
newf=`echo hi newf | git-hash-object -w --stdin`
178
 
oldf=`git-rev-parse --verify master:file2`
 
225
oldf=`git rev-parse --verify master:file2`
179
226
test_tick
180
227
cat >input <<INPUT_END
181
228
commit refs/heads/branch
193
240
test_expect_success \
194
241
    'C: incremental import create pack from stdin' \
195
242
    'git-fast-import <input &&
196
 
         git-whatchanged branch'
 
243
         git whatchanged branch'
197
244
test_expect_success \
198
245
        'C: verify pack' \
199
 
        'for p in .git/objects/pack/*.pack;do git-verify-pack $p||exit;done'
 
246
        'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done'
200
247
test_expect_success \
201
248
        'C: validate reuse existing blob' \
202
 
        'test $newf = `git-rev-parse --verify branch:file2/newf`
203
 
         test $oldf = `git-rev-parse --verify branch:file2/oldf`'
 
249
        'test $newf = `git rev-parse --verify branch:file2/newf`
 
250
         test $oldf = `git rev-parse --verify branch:file2/oldf`'
204
251
 
205
252
cat >expect <<EOF
206
 
parent `git-rev-parse --verify master^0`
 
253
parent `git rev-parse --verify master^0`
207
254
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
208
255
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
209
256
 
211
258
EOF
212
259
test_expect_success \
213
260
        'C: verify commit' \
214
 
        'git-cat-file commit branch | sed 1d >actual &&
 
261
        'git cat-file commit branch | sed 1d >actual &&
215
262
         git diff expect actual'
216
263
 
217
264
cat >expect <<EOF
219
266
:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 R100   file2   file2/oldf
220
267
:100644 000000 0d92e9f3374ae2947c23aa477cbc68ce598135f1 0000000000000000000000000000000000000000 D      file3
221
268
EOF
222
 
git-diff-tree -M -r master branch >actual
 
269
git diff-tree -M -r master branch >actual
223
270
test_expect_success \
224
271
        'C: validate rename result' \
225
272
        'compare_diff_raw expect actual'
251
298
test_expect_success \
252
299
    'D: inline data in commit' \
253
300
    'git-fast-import <input &&
254
 
         git-whatchanged branch'
 
301
         git whatchanged branch'
255
302
test_expect_success \
256
303
        'D: verify pack' \
257
 
        'for p in .git/objects/pack/*.pack;do git-verify-pack $p||exit;done'
 
304
        'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done'
258
305
 
259
306
cat >expect <<EOF
260
307
:000000 100755 0000000000000000000000000000000000000000 35a59026a33beac1569b1c7f66f3090ce9c09afc A      newdir/exec.sh
261
308
:000000 100644 0000000000000000000000000000000000000000 046d0371e9220107917db0d0e030628de8a1de9b A      newdir/interesting
262
309
EOF
263
 
git-diff-tree -M -r branch^ branch >actual
 
310
git diff-tree -M -r branch^ branch >actual
264
311
test_expect_success \
265
312
        'D: validate new files added' \
266
313
        'compare_diff_raw expect actual'
268
315
echo "$file5_data" >expect
269
316
test_expect_success \
270
317
        'D: verify file5' \
271
 
        'git-cat-file blob branch:newdir/interesting >actual &&
 
318
        'git cat-file blob branch:newdir/interesting >actual &&
272
319
         git diff expect actual'
273
320
 
274
321
echo "$file6_data" >expect
275
322
test_expect_success \
276
323
        'D: verify file6' \
277
 
        'git-cat-file blob branch:newdir/exec.sh >actual &&
 
324
        'git cat-file blob branch:newdir/exec.sh >actual &&
278
325
         git diff expect actual'
279
326
 
280
327
###
300
347
    'git-fast-import --date-format=rfc2822 <input'
301
348
test_expect_success \
302
349
        'E: verify pack' \
303
 
        'for p in .git/objects/pack/*.pack;do git-verify-pack $p||exit;done'
 
350
        'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done'
304
351
 
305
352
cat >expect <<EOF
306
353
author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> 1170778938 -0500
310
357
EOF
311
358
test_expect_success \
312
359
        'E: verify commit' \
313
 
        'git-cat-file commit branch | sed 1,2d >actual &&
 
360
        'git cat-file commit branch | sed 1,2d >actual &&
314
361
        git diff expect actual'
315
362
 
316
363
###
317
364
### series F
318
365
###
319
366
 
320
 
old_branch=`git-rev-parse --verify branch^0`
 
367
old_branch=`git rev-parse --verify branch^0`
321
368
test_tick
322
369
cat >input <<INPUT_END
323
370
commit refs/heads/branch
339
386
                echo BAD gfi did not fail
340
387
                return 1
341
388
         else
342
 
                if test $old_branch = `git-rev-parse --verify branch^0`
 
389
                if test $old_branch = `git rev-parse --verify branch^0`
343
390
                then
344
391
                        : branch unaffected and failure returned
345
392
                        return 0
351
398
        '
352
399
test_expect_success \
353
400
        'F: verify pack' \
354
 
        'for p in .git/objects/pack/*.pack;do git-verify-pack $p||exit;done'
 
401
        'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done'
355
402
 
356
403
cat >expect <<EOF
357
 
tree `git-rev-parse branch~1^{tree}`
358
 
parent `git-rev-parse branch~1`
 
404
tree `git rev-parse branch~1^{tree}`
 
405
parent `git rev-parse branch~1`
359
406
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
360
407
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
361
408
 
363
410
EOF
364
411
test_expect_success \
365
412
        'F: verify other commit' \
366
 
        'git-cat-file commit other >actual &&
 
413
        'git cat-file commit other >actual &&
367
414
        git diff expect actual'
368
415
 
369
416
###
370
417
### series G
371
418
###
372
419
 
373
 
old_branch=`git-rev-parse --verify branch^0`
 
420
old_branch=`git rev-parse --verify branch^0`
374
421
test_tick
375
422
cat >input <<INPUT_END
376
423
commit refs/heads/branch
387
434
    'git-fast-import --force <input'
388
435
test_expect_success \
389
436
        'G: verify pack' \
390
 
        'for p in .git/objects/pack/*.pack;do git-verify-pack $p||exit;done'
 
437
        'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done'
391
438
test_expect_success \
392
439
        'G: branch changed, but logged' \
393
 
        'test $old_branch != `git-rev-parse --verify branch^0` &&
394
 
         test $old_branch = `git-rev-parse --verify branch@{1}`'
 
440
        'test $old_branch != `git rev-parse --verify branch^0` &&
 
441
         test $old_branch = `git rev-parse --verify branch@{1}`'
395
442
 
396
443
###
397
444
### series H
421
468
test_expect_success \
422
469
    'H: deletall, add 1' \
423
470
    'git-fast-import <input &&
424
 
         git-whatchanged H'
 
471
         git whatchanged H'
425
472
test_expect_success \
426
473
        'H: verify pack' \
427
 
        'for p in .git/objects/pack/*.pack;do git-verify-pack $p||exit;done'
 
474
        'for p in .git/objects/pack/*.pack;do git verify-pack $p||exit;done'
428
475
 
429
476
cat >expect <<EOF
430
477
:100755 000000 f1fb5da718392694d0076d677d6d0e364c79b0bc 0000000000000000000000000000000000000000 D      file2/newf
433
480
:100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 R100   newdir/interesting      h/e/l/lo
434
481
:100755 000000 e74b7d465e52746be2b4bae983670711e6e66657 0000000000000000000000000000000000000000 D      newdir/exec.sh
435
482
EOF
436
 
git-diff-tree -M -r H^ H >actual
 
483
git diff-tree -M -r H^ H >actual
437
484
test_expect_success \
438
485
        'H: validate old files removed, new files added' \
439
486
        'compare_diff_raw expect actual'
441
488
echo "$file5_data" >expect
442
489
test_expect_success \
443
490
        'H: verify file' \
444
 
        'git-cat-file blob H:h/e/l/lo >actual &&
 
491
        'git cat-file blob H:h/e/l/lo >actual &&
445
492
         git diff expect actual'
446
493
 
447
494
###
463
510
    'git-fast-import --export-pack-edges=edges.list <input'
464
511
 
465
512
cat >expect <<EOF
466
 
.git/objects/pack/pack-.pack: `git-rev-parse --verify export-boundary`
 
513
.git/objects/pack/pack-.pack: `git rev-parse --verify export-boundary`
467
514
EOF
468
515
test_expect_success \
469
516
        'I: verify edge list' \
497
544
    'git-fast-import <input'
498
545
test_expect_success \
499
546
        'J: branch has 1 commit, empty tree' \
500
 
        'test 1 = `git-rev-list J | wc -l` &&
 
547
        'test 1 = `git rev-list J | wc -l` &&
501
548
         test 0 = `git ls-tree J | wc -l`'
502
549
 
503
550
###
527
574
    'git-fast-import <input'
528
575
test_expect_success \
529
576
    'K: verify K^1 = branch^1' \
530
 
    'test `git-rev-parse --verify branch^1` \
531
 
                = `git-rev-parse --verify K^1`'
 
577
    'test `git rev-parse --verify branch^1` \
 
578
                = `git rev-parse --verify K^1`'
532
579
 
533
580
###
534
581
### series L
577
624
test_expect_success \
578
625
    'L: verify internal tree sorting' \
579
626
        'git-fast-import <input &&
580
 
         git-diff --raw L^ L >output &&
 
627
         git diff-tree --abbrev --raw L^ L >output &&
581
628
         git diff expect output'
582
629
 
 
630
###
 
631
### series M
 
632
###
 
633
 
 
634
test_tick
 
635
cat >input <<INPUT_END
 
636
commit refs/heads/M1
 
637
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
638
data <<COMMIT
 
639
file rename
 
640
COMMIT
 
641
 
 
642
from refs/heads/branch^0
 
643
R file2/newf file2/n.e.w.f
 
644
 
 
645
INPUT_END
 
646
 
 
647
cat >expect <<EOF
 
648
:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100   file2/newf      file2/n.e.w.f
 
649
EOF
 
650
test_expect_success \
 
651
        'M: rename file in same subdirectory' \
 
652
        'git-fast-import <input &&
 
653
         git diff-tree -M -r M1^ M1 >actual &&
 
654
         compare_diff_raw expect actual'
 
655
 
 
656
cat >input <<INPUT_END
 
657
commit refs/heads/M2
 
658
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
659
data <<COMMIT
 
660
file rename
 
661
COMMIT
 
662
 
 
663
from refs/heads/branch^0
 
664
R file2/newf i/am/new/to/you
 
665
 
 
666
INPUT_END
 
667
 
 
668
cat >expect <<EOF
 
669
:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100   file2/newf      i/am/new/to/you
 
670
EOF
 
671
test_expect_success \
 
672
        'M: rename file to new subdirectory' \
 
673
        'git-fast-import <input &&
 
674
         git diff-tree -M -r M2^ M2 >actual &&
 
675
         compare_diff_raw expect actual'
 
676
 
 
677
cat >input <<INPUT_END
 
678
commit refs/heads/M3
 
679
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
680
data <<COMMIT
 
681
file rename
 
682
COMMIT
 
683
 
 
684
from refs/heads/M2^0
 
685
R i other/sub
 
686
 
 
687
INPUT_END
 
688
 
 
689
cat >expect <<EOF
 
690
:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc R100   i/am/new/to/you other/sub/am/new/to/you
 
691
EOF
 
692
test_expect_success \
 
693
        'M: rename subdirectory to new subdirectory' \
 
694
        'git-fast-import <input &&
 
695
         git diff-tree -M -r M3^ M3 >actual &&
 
696
         compare_diff_raw expect actual'
 
697
 
 
698
###
 
699
### series N
 
700
###
 
701
 
 
702
test_tick
 
703
cat >input <<INPUT_END
 
704
commit refs/heads/N1
 
705
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
706
data <<COMMIT
 
707
file copy
 
708
COMMIT
 
709
 
 
710
from refs/heads/branch^0
 
711
C file2/newf file2/n.e.w.f
 
712
 
 
713
INPUT_END
 
714
 
 
715
cat >expect <<EOF
 
716
:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100   file2/newf      file2/n.e.w.f
 
717
EOF
 
718
test_expect_success \
 
719
        'N: copy file in same subdirectory' \
 
720
        'git-fast-import <input &&
 
721
         git diff-tree -C --find-copies-harder -r N1^ N1 >actual &&
 
722
         compare_diff_raw expect actual'
 
723
 
 
724
cat >input <<INPUT_END
 
725
commit refs/heads/N2
 
726
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
727
data <<COMMIT
 
728
clean directory copy
 
729
COMMIT
 
730
 
 
731
from refs/heads/branch^0
 
732
C file2 file3
 
733
 
 
734
commit refs/heads/N2
 
735
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
736
data <<COMMIT
 
737
modify directory copy
 
738
COMMIT
 
739
 
 
740
M 644 inline file3/file5
 
741
data <<EOF
 
742
$file5_data
 
743
EOF
 
744
 
 
745
INPUT_END
 
746
 
 
747
cat >expect <<EOF
 
748
:100644 100644 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791 C100   newdir/interesting      file3/file5
 
749
:100755 100755 f1fb5da718392694d0076d677d6d0e364c79b0bc f1fb5da718392694d0076d677d6d0e364c79b0bc C100   file2/newf      file3/newf
 
750
:100644 100644 7123f7f44e39be127c5eb701e5968176ee9d78b1 7123f7f44e39be127c5eb701e5968176ee9d78b1 C100   file2/oldf      file3/oldf
 
751
EOF
 
752
test_expect_success \
 
753
        'N: copy then modify subdirectory' \
 
754
        'git-fast-import <input &&
 
755
         git diff-tree -C --find-copies-harder -r N2^^ N2 >actual &&
 
756
         compare_diff_raw expect actual'
 
757
 
 
758
cat >input <<INPUT_END
 
759
commit refs/heads/N3
 
760
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
761
data <<COMMIT
 
762
dirty directory copy
 
763
COMMIT
 
764
 
 
765
from refs/heads/branch^0
 
766
M 644 inline file2/file5
 
767
data <<EOF
 
768
$file5_data
 
769
EOF
 
770
 
 
771
C file2 file3
 
772
D file2/file5
 
773
 
 
774
INPUT_END
 
775
 
 
776
test_expect_success \
 
777
        'N: copy dirty subdirectory' \
 
778
        'git-fast-import <input &&
 
779
         test `git-rev-parse N2^{tree}` = `git-rev-parse N3^{tree}`'
 
780
 
 
781
###
 
782
### series O
 
783
###
 
784
 
 
785
cat >input <<INPUT_END
 
786
#we will
 
787
commit refs/heads/O1
 
788
# -- ignore all of this text
 
789
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
790
# $GIT_COMMITTER_NAME has inserted here for his benefit.
 
791
data <<COMMIT
 
792
dirty directory copy
 
793
COMMIT
 
794
 
 
795
# don't forget the import blank line!
 
796
#
 
797
# yes, we started from our usual base of branch^0.
 
798
# i like branch^0.
 
799
from refs/heads/branch^0
 
800
# and we need to reuse file2/file5 from N3 above.
 
801
M 644 inline file2/file5
 
802
# otherwise the tree will be different
 
803
data <<EOF
 
804
$file5_data
 
805
EOF
 
806
 
 
807
# don't forget to copy file2 to file3
 
808
C file2 file3
 
809
#
 
810
# or to delete file5 from file2.
 
811
D file2/file5
 
812
# are we done yet?
 
813
 
 
814
INPUT_END
 
815
 
 
816
test_expect_success \
 
817
        'O: comments are all skipped' \
 
818
        'git-fast-import <input &&
 
819
         test `git-rev-parse N3` = `git-rev-parse O1`'
 
820
 
 
821
cat >input <<INPUT_END
 
822
commit refs/heads/O2
 
823
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
824
data <<COMMIT
 
825
dirty directory copy
 
826
COMMIT
 
827
from refs/heads/branch^0
 
828
M 644 inline file2/file5
 
829
data <<EOF
 
830
$file5_data
 
831
EOF
 
832
C file2 file3
 
833
D file2/file5
 
834
 
 
835
INPUT_END
 
836
 
 
837
test_expect_success \
 
838
        'O: blank lines not necessary after data commands' \
 
839
        'git-fast-import <input &&
 
840
         test `git-rev-parse N3` = `git-rev-parse O2`'
 
841
 
 
842
test_expect_success \
 
843
        'O: repack before next test' \
 
844
        'git repack -a -d'
 
845
 
 
846
cat >input <<INPUT_END
 
847
commit refs/heads/O3
 
848
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
849
data <<COMMIT
 
850
zstring
 
851
COMMIT
 
852
commit refs/heads/O3
 
853
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
854
data <<COMMIT
 
855
zof
 
856
COMMIT
 
857
checkpoint
 
858
commit refs/heads/O3
 
859
mark :5
 
860
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
861
data <<COMMIT
 
862
zempty
 
863
COMMIT
 
864
checkpoint
 
865
commit refs/heads/O3
 
866
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
867
data <<COMMIT
 
868
zcommits
 
869
COMMIT
 
870
reset refs/tags/O3-2nd
 
871
from :5
 
872
INPUT_END
 
873
 
 
874
cat >expect <<INPUT_END
 
875
string
 
876
of
 
877
empty
 
878
commits
 
879
INPUT_END
 
880
test_expect_success \
 
881
        'O: blank lines not necessary after other commands' \
 
882
        'git-fast-import <input &&
 
883
         test 8 = `find .git/objects/pack -type f | wc -l` &&
 
884
         test `git rev-parse refs/tags/O3-2nd` = `git rev-parse O3^` &&
 
885
         git log --reverse --pretty=oneline O3 | sed s/^.*z// >actual &&
 
886
         git diff expect actual'
 
887
 
 
888
cat >input <<INPUT_END
 
889
commit refs/heads/O4
 
890
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
891
data <<COMMIT
 
892
zstring
 
893
COMMIT
 
894
commit refs/heads/O4
 
895
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
896
data <<COMMIT
 
897
zof
 
898
COMMIT
 
899
progress Two commits down, 2 to go!
 
900
commit refs/heads/O4
 
901
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
902
data <<COMMIT
 
903
zempty
 
904
COMMIT
 
905
progress Three commits down, 1 to go!
 
906
commit refs/heads/O4
 
907
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
 
908
data <<COMMIT
 
909
zcommits
 
910
COMMIT
 
911
progress I'm done!
 
912
INPUT_END
 
913
test_expect_success \
 
914
        'O: progress outputs as requested by input' \
 
915
        'git-fast-import <input >actual &&
 
916
         grep "progress " <input >expect &&
 
917
         git diff expect actual'
 
918
 
583
919
test_done