@@ -589,141 +589,6 @@ test_expect_success 'prefetch objects' '
589
589
test_line_count = 1 donelines
590
590
'
591
591
592
- test_expect_success ' setup for --stdin-packs tests' '
593
- git init stdin-packs &&
594
- (
595
- cd stdin-packs &&
596
-
597
- test_commit A &&
598
- test_commit B &&
599
- test_commit C &&
600
-
601
- for id in A B C
602
- do
603
- git pack-objects .git/objects/pack/pack-$id \
604
- --incremental --revs <<-EOF || exit 1
605
- refs/tags/$id
606
- EOF
607
- done &&
608
-
609
- ls -la .git/objects/pack
610
- )
611
- '
612
-
613
- test_expect_success ' --stdin-packs with excluded packs' '
614
- (
615
- cd stdin-packs &&
616
-
617
- PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
618
- PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
619
- PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
620
-
621
- git pack-objects test --stdin-packs <<-EOF &&
622
- $PACK_A
623
- ^$PACK_B
624
- $PACK_C
625
- EOF
626
-
627
- (
628
- git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
629
- git show-index <$(ls .git/objects/pack/pack-C-*.idx)
630
- ) >expect.raw &&
631
- git show-index <$(ls test-*.idx) >actual.raw &&
632
-
633
- cut -d" " -f2 <expect.raw | sort >expect &&
634
- cut -d" " -f2 <actual.raw | sort >actual &&
635
- test_cmp expect actual
636
- )
637
- '
638
-
639
- test_expect_success ' --stdin-packs is incompatible with --filter' '
640
- (
641
- cd stdin-packs &&
642
- test_must_fail git pack-objects --stdin-packs --stdout \
643
- --filter=blob:none </dev/null 2>err &&
644
- test_i18ngrep "cannot use --filter with --stdin-packs" err
645
- )
646
- '
647
-
648
- test_expect_success ' --stdin-packs is incompatible with --revs' '
649
- (
650
- cd stdin-packs &&
651
- test_must_fail git pack-objects --stdin-packs --revs out \
652
- </dev/null 2>err &&
653
- test_i18ngrep "cannot use internal rev list with --stdin-packs" err
654
- )
655
- '
656
-
657
- test_expect_success ' --stdin-packs with loose objects' '
658
- (
659
- cd stdin-packs &&
660
-
661
- PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
662
- PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
663
- PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
664
-
665
- test_commit D && # loose
666
-
667
- git pack-objects test2 --stdin-packs --unpacked <<-EOF &&
668
- $PACK_A
669
- ^$PACK_B
670
- $PACK_C
671
- EOF
672
-
673
- (
674
- git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
675
- git show-index <$(ls .git/objects/pack/pack-C-*.idx) &&
676
- git rev-list --objects --no-object-names \
677
- refs/tags/C..refs/tags/D
678
-
679
- ) >expect.raw &&
680
- ls -la . &&
681
- git show-index <$(ls test2-*.idx) >actual.raw &&
682
-
683
- cut -d" " -f2 <expect.raw | sort >expect &&
684
- cut -d" " -f2 <actual.raw | sort >actual &&
685
- test_cmp expect actual
686
- )
687
- '
688
-
689
- test_expect_success ' --stdin-packs with broken links' '
690
- (
691
- cd stdin-packs &&
692
-
693
- # make an unreachable object with a bogus parent
694
- git cat-file -p HEAD >commit &&
695
- sed "s/$(git rev-parse HEAD^)/$(test_oid zero)/" <commit |
696
- git hash-object -w -t commit --stdin >in &&
697
-
698
- git pack-objects .git/objects/pack/pack-D <in &&
699
-
700
- PACK_A="$(basename .git/objects/pack/pack-A-*.pack)" &&
701
- PACK_B="$(basename .git/objects/pack/pack-B-*.pack)" &&
702
- PACK_C="$(basename .git/objects/pack/pack-C-*.pack)" &&
703
- PACK_D="$(basename .git/objects/pack/pack-D-*.pack)" &&
704
-
705
- git pack-objects test3 --stdin-packs --unpacked <<-EOF &&
706
- $PACK_A
707
- ^$PACK_B
708
- $PACK_C
709
- $PACK_D
710
- EOF
711
-
712
- (
713
- git show-index <$(ls .git/objects/pack/pack-A-*.idx) &&
714
- git show-index <$(ls .git/objects/pack/pack-C-*.idx) &&
715
- git show-index <$(ls .git/objects/pack/pack-D-*.idx) &&
716
- git rev-list --objects --no-object-names \
717
- refs/tags/C..refs/tags/D
718
- ) >expect.raw &&
719
- git show-index <$(ls test3-*.idx) >actual.raw &&
720
-
721
- cut -d" " -f2 <expect.raw | sort >expect &&
722
- cut -d" " -f2 <actual.raw | sort >actual &&
723
- test_cmp expect actual
724
- )
725
- '
726
-
727
592
test_expect_success ' negative window clamps to 0' '
728
593
git pack-objects --progress --window=-1 neg-window <obj-list 2>stderr &&
729
594
check_deltas stderr = 0
0 commit comments