Skip to content

Commit 0c0f8a7

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 4cf76f6 commit 0c0f8a7

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed

t/t0021-conversion.sh

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,6 +488,51 @@ test_expect_success PERL 'required process filter should filter data for various
488488
IN: smudge testsubdir/test3 '\''sq'\'',\$x=.r $META blob=$M3 $S3 [OK] -- OUT: $S3 . [OK]
489489
STOP
490490
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
491536
test_cmp_exclude_clean expected.log debug.log
492537
)
493538
'

0 commit comments

Comments
 (0)