@@ -382,7 +382,8 @@ test_expect_success PERL 'required process filter should filter data' '
382382 test_cmp_count expected.log debug.log &&
383383
384384 git commit -m "test commit 2" &&
385- META="ref=refs/heads/master treeish=$(git rev-parse --verify master)" &&
385+ MASTER=$(git rev-parse --verify master) &&
386+ META="ref=refs/heads/master treeish=$MASTER" &&
386387 rm -f test2.r "testsubdir/test3 ' \' ' sq' \' ' ,\$x=.r" &&
387388
388389 filter_git checkout --quiet --no-progress . &&
@@ -425,6 +426,42 @@ test_expect_success PERL 'required process filter should filter data' '
425426 )
426427'
427428
429+ test_expect_success PERL ' required process filter should filter data for various subcommands' '
430+ test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
431+ test_config_global filter.protocol.required true &&
432+ (
433+ cd repo &&
434+
435+ S=$(file_size test.r) &&
436+ S2=$(file_size test2.r) &&
437+ S3=$(file_size "testsubdir/test3 ' \' ' sq' \' ' ,\$x=.r") &&
438+ M=$(git hash-object test.r) &&
439+ M2=$(git hash-object test2.r) &&
440+ M3=$(git hash-object "testsubdir/test3 ' \' ' sq' \' ' ,\$x=.r") &&
441+ EMPTY=$(git hash-object /dev/null) &&
442+
443+ MASTER=$(git rev-parse --verify master) &&
444+
445+ cp "$TEST_ROOT/test.o" test5.r &&
446+ git add test5.r &&
447+ git commit -m "test commit 3" &&
448+ git checkout empty-branch &&
449+ filter_git rebase --onto empty-branch master^^ master &&
450+ META="ref=refs/heads/master treeish=$(git rev-parse --verify master)" &&
451+ cat >expected.log <<-EOF &&
452+ START
453+ init handshake complete
454+ IN: smudge test.r $META blob=$M $S [OK] -- OUT: $S . [OK]
455+ IN: smudge test2.r $META blob=$M2 $S2 [OK] -- OUT: $S2 . [OK]
456+ IN: smudge test4-empty.r $META blob=$EMPTY 0 [OK] -- OUT: 0 [OK]
457+ IN: smudge test5.r $META blob=$M $S [OK] -- OUT: $S . [OK]
458+ IN: smudge testsubdir/test3 ' \' ' sq' \' ' ,\$x=.r $META blob=$M3 $S3 [OK] -- OUT: $S3 . [OK]
459+ STOP
460+ EOF
461+ test_cmp_exclude_clean expected.log debug.log
462+ )
463+ '
464+
428465test_expect_success PERL ' required process filter takes precedence' '
429466 test_config_global filter.protocol.clean false &&
430467 test_config_global filter.protocol.process "rot13-filter.pl debug.log clean" &&
0 commit comments