@matheusbsbs / matheus-bagliano / commits / 0c0f8a7f28
Fork 0

t0021: test filter metadata for additional cases

Check that we get the expected data when performing a merges or generating archives. Note that we don't expect a ref for merges, because we won't be checking out any particular ref, but instead a tree of the merged data. For archives, however, we expect a ref as normal if we have one. Signed-off-by: brian m. carlson <bk2204@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed Mar 16, 2020 at 18:05 UTC 0c0f8a7f28672fa323312fbba394e5a9949b2aad
1 file changed +45
t/t0021-conversion.sh
+45
@@ -488,6 +488,51 @@ test_expect_success PERL 'required process filter should filter data for various
488 IN: smudge testsubdir/test3 '\''sq'\'',\$x=.r $META blob=$M3 $S3 [OK] -- OUT: $S3 . [OK]
489 STOP
490 EOF
491 + test_cmp_exclude_clean expected.log debug.log &&
492 +
493 + git checkout -b merge empty-branch &&
494 + git branch -f master $MASTER2 &&
495 + filter_git merge master &&
496 + META="treeish=$MASTER2" &&
497 + cat >expected.log <<-EOF &&
498 + START
499 + init handshake complete
500 + IN: smudge test.r $META blob=$M $S [OK] -- OUT: $S . [OK]
501 + IN: smudge test2.r $META blob=$M2 $S2 [OK] -- OUT: $S2 . [OK]
502 + IN: smudge test4-empty.r $META blob=$EMPTY 0 [OK] -- OUT: 0 [OK]
503 + IN: smudge test5.r $META blob=$M $S [OK] -- OUT: $S . [OK]
504 + IN: smudge testsubdir/test3 '\''sq'\'',\$x=.r $META blob=$M3 $S3 [OK] -- OUT: $S3 . [OK]
505 + STOP
506 + EOF
507 + test_cmp_exclude_clean expected.log debug.log &&
508 +
509 + filter_git archive master >/dev/null &&
510 + META="ref=refs/heads/master treeish=$MASTER2" &&
511 + cat >expected.log <<-EOF &&
512 + START
513 + init handshake complete
514 + IN: smudge test.r $META blob=$M $S [OK] -- OUT: $S . [OK]
515 + IN: smudge test2.r $META blob=$M2 $S2 [OK] -- OUT: $S2 . [OK]
516 + IN: smudge test4-empty.r $META blob=$EMPTY 0 [OK] -- OUT: 0 [OK]
517 + IN: smudge test5.r $META blob=$M $S [OK] -- OUT: $S . [OK]
518 + IN: smudge testsubdir/test3 '\''sq'\'',\$x=.r $META blob=$M3 $S3 [OK] -- OUT: $S3 . [OK]
519 + STOP
520 + EOF
521 + test_cmp_exclude_clean expected.log debug.log &&
522 +
523 + TREE="$(git rev-parse $MASTER2^{tree})" &&
524 + filter_git archive $TREE >/dev/null &&
525 + META="treeish=$TREE" &&
526 + cat >expected.log <<-EOF &&
527 + START
528 + init handshake complete
529 + IN: smudge test.r $META blob=$M $S [OK] -- OUT: $S . [OK]
530 + IN: smudge test2.r $META blob=$M2 $S2 [OK] -- OUT: $S2 . [OK]
531 + IN: smudge test4-empty.r $META blob=$EMPTY 0 [OK] -- OUT: 0 [OK]
532 + IN: smudge test5.r $META blob=$M $S [OK] -- OUT: $S . [OK]
533 + IN: smudge testsubdir/test3 '\''sq'\'',\$x=.r $META blob=$M3 $S3 [OK] -- OUT: $S3 . [OK]
534 + STOP
535 + EOF
536 test_cmp_exclude_clean expected.log debug.log
537 )
538 '