@ -28,7 +28,7 @@ file_size () {
}
}
filter_git () {
filter_git () {
rm -f rot13-filter.log &&
rm -f *.log &&
git "$@"
git "$@"
}
}
@ -342,7 +342,7 @@ test_expect_success 'diff does not reuse worktree files that need cleaning' '
'
'
test_expect_success PERL 'required process filter should filter data' '
test_expect_success PERL 'required process filter should filter data' '
test_config_global filter.protocol.process "rot13-filter.pl clean smudge" &&
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
test_config_global filter.protocol.required true &&
test_config_global filter.protocol.required true &&
rm -rf repo &&
rm -rf repo &&
mkdir repo &&
mkdir repo &&
@ -375,7 +375,7 @@ test_expect_success PERL 'required process filter should filter data' '
IN: clean testsubdir/test3 '\''sq'\'',\$x=.r $S3 [OK] -- OUT: $S3 . [OK]
IN: clean testsubdir/test3 '\''sq'\'',\$x=.r $S3 [OK] -- OUT: $S3 . [OK]
STOP
STOP
EOF
EOF
test_cmp_count expected.log rot13-filter.log &&
test_cmp_count expected.log debug.log &&
git commit -m "test commit 2" &&
git commit -m "test commit 2" &&
rm -f test2.r "testsubdir/test3 '\''sq'\'',\$x=.r" &&
rm -f test2.r "testsubdir/test3 '\''sq'\'',\$x=.r" &&
@ -388,7 +388,7 @@ test_expect_success PERL 'required process filter should filter data' '
IN: smudge testsubdir/test3 '\''sq'\'',\$x=.r $S3 [OK] -- OUT: $S3 . [OK]
IN: smudge testsubdir/test3 '\''sq'\'',\$x=.r $S3 [OK] -- OUT: $S3 . [OK]
STOP
STOP
EOF
EOF
test_cmp_exclude_clean expected.log rot13-filter.log &&
test_cmp_exclude_clean expected.log debug.log &&
filter_git checkout --quiet --no-progress empty-branch &&
filter_git checkout --quiet --no-progress empty-branch &&
cat >expected.log <<-EOF &&
cat >expected.log <<-EOF &&
@ -397,7 +397,7 @@ test_expect_success PERL 'required process filter should filter data' '
IN: clean test.r $S [OK] -- OUT: $S . [OK]
IN: clean test.r $S [OK] -- OUT: $S . [OK]
STOP
STOP
EOF
EOF
test_cmp_exclude_clean expected.log rot13-filter.log &&
test_cmp_exclude_clean expected.log debug.log &&
filter_git checkout --quiet --no-progress master &&
filter_git checkout --quiet --no-progress master &&
cat >expected.log <<-EOF &&
cat >expected.log <<-EOF &&
@ -409,7 +409,7 @@ test_expect_success PERL 'required process filter should filter data' '
IN: smudge testsubdir/test3 '\''sq'\'',\$x=.r $S3 [OK] -- OUT: $S3 . [OK]
IN: smudge testsubdir/test3 '\''sq'\'',\$x=.r $S3 [OK] -- OUT: $S3 . [OK]
STOP
STOP
EOF
EOF
test_cmp_exclude_clean expected.log rot13-filter.log &&
test_cmp_exclude_clean expected.log debug.log &&
test_cmp_committed_rot13 "$TEST_ROOT/test.o" test.r &&
test_cmp_committed_rot13 "$TEST_ROOT/test.o" test.r &&
test_cmp_committed_rot13 "$TEST_ROOT/test2.o" test2.r &&
test_cmp_committed_rot13 "$TEST_ROOT/test2.o" test2.r &&
@ -419,7 +419,7 @@ test_expect_success PERL 'required process filter should filter data' '
test_expect_success PERL 'required process filter takes precedence' '
test_expect_success PERL 'required process filter takes precedence' '
test_config_global filter.protocol.clean false &&
test_config_global filter.protocol.clean false &&
test_config_global filter.protocol.process "rot13-filter.pl clean" &&
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean" &&
test_config_global filter.protocol.required true &&
test_config_global filter.protocol.required true &&
rm -rf repo &&
rm -rf repo &&
mkdir repo &&
mkdir repo &&
@ -439,12 +439,12 @@ test_expect_success PERL 'required process filter takes precedence' '
IN: clean test.r $S [OK] -- OUT: $S . [OK]
IN: clean test.r $S [OK] -- OUT: $S . [OK]
STOP
STOP
EOF
EOF
test_cmp_count expected.log rot13-filter.log
test_cmp_count expected.log debug.log
)
)
'
'
test_expect_success PERL 'required process filter should be used only for "clean" operation only' '
test_expect_success PERL 'required process filter should be used only for "clean" operation only' '
test_config_global filter.protocol.process "rot13-filter.pl clean" &&
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean" &&
rm -rf repo &&
rm -rf repo &&
mkdir repo &&
mkdir repo &&
(
(
@ -462,7 +462,7 @@ test_expect_success PERL 'required process filter should be used only for "clean
IN: clean test.r $S [OK] -- OUT: $S . [OK]
IN: clean test.r $S [OK] -- OUT: $S . [OK]
STOP
STOP
EOF
EOF
test_cmp_count expected.log rot13-filter.log &&
test_cmp_count expected.log debug.log &&
rm test.r &&
rm test.r &&
@ -474,12 +474,12 @@ test_expect_success PERL 'required process filter should be used only for "clean
init handshake complete
init handshake complete
STOP
STOP
EOF
EOF
test_cmp_exclude_clean expected.log rot13-filter.log
test_cmp_exclude_clean expected.log debug.log
)
)
'
'
test_expect_success PERL 'required process filter should process multiple packets' '
test_expect_success PERL 'required process filter should process multiple packets' '
test_config_global filter.protocol.process "rot13-filter.pl clean smudge" &&
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
test_config_global filter.protocol.required true &&
test_config_global filter.protocol.required true &&
rm -rf repo &&
rm -rf repo &&
@ -514,7 +514,7 @@ test_expect_success PERL 'required process filter should process multiple packet
IN: clean 3pkt_2+1.file $(($S*2+1)) [OK] -- OUT: $(($S*2+1)) ... [OK]
IN: clean 3pkt_2+1.file $(($S*2+1)) [OK] -- OUT: $(($S*2+1)) ... [OK]
STOP
STOP
EOF
EOF
test_cmp_count expected.log rot13-filter.log &&
test_cmp_count expected.log debug.log &&
rm -f *.file &&
rm -f *.file &&
@ -529,7 +529,7 @@ test_expect_success PERL 'required process filter should process multiple packet
IN: smudge 3pkt_2+1.file $(($S*2+1)) [OK] -- OUT: $(($S*2+1)) ... [OK]
IN: smudge 3pkt_2+1.file $(($S*2+1)) [OK] -- OUT: $(($S*2+1)) ... [OK]
STOP
STOP
EOF
EOF
test_cmp_exclude_clean expected.log rot13-filter.log &&
test_cmp_exclude_clean expected.log debug.log &&
for FILE in *.file
for FILE in *.file
do
do
@ -539,7 +539,7 @@ test_expect_success PERL 'required process filter should process multiple packet
'
'
test_expect_success PERL 'required process filter with clean error should fail' '
test_expect_success PERL 'required process filter with clean error should fail' '
test_config_global filter.protocol.process "rot13-filter.pl clean smudge" &&
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
test_config_global filter.protocol.required true &&
test_config_global filter.protocol.required true &&
rm -rf repo &&
rm -rf repo &&
mkdir repo &&
mkdir repo &&
@ -558,7 +558,7 @@ test_expect_success PERL 'required process filter with clean error should fail'
'
'
test_expect_success PERL 'process filter should restart after unexpected write failure' '
test_expect_success PERL 'process filter should restart after unexpected write failure' '
test_config_global filter.protocol.process "rot13-filter.pl clean smudge" &&
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
rm -rf repo &&
rm -rf repo &&
mkdir repo &&
mkdir repo &&
(
(
@ -579,7 +579,7 @@ test_expect_success PERL 'process filter should restart after unexpected write f
git add . &&
git add . &&
rm -f *.r &&
rm -f *.r &&
rm -f rot13-filter.log &&
rm -f debug.log &&
git checkout --quiet --no-progress . 2>git-stderr.log &&
git checkout --quiet --no-progress . 2>git-stderr.log &&
grep "smudge write error at" git-stderr.log &&
grep "smudge write error at" git-stderr.log &&
@ -595,7 +595,7 @@ test_expect_success PERL 'process filter should restart after unexpected write f
IN: smudge test2.r $S2 [OK] -- OUT: $S2 . [OK]
IN: smudge test2.r $S2 [OK] -- OUT: $S2 . [OK]
STOP
STOP
EOF
EOF
test_cmp_exclude_clean expected.log rot13-filter.log &&
test_cmp_exclude_clean expected.log debug.log &&
test_cmp_committed_rot13 "$TEST_ROOT/test.o" test.r &&
test_cmp_committed_rot13 "$TEST_ROOT/test.o" test.r &&
test_cmp_committed_rot13 "$TEST_ROOT/test2.o" test2.r &&
test_cmp_committed_rot13 "$TEST_ROOT/test2.o" test2.r &&
@ -609,7 +609,7 @@ test_expect_success PERL 'process filter should restart after unexpected write f
'
'
test_expect_success PERL 'process filter should not be restarted if it signals an error' '
test_expect_success PERL 'process filter should not be restarted if it signals an error' '
test_config_global filter.protocol.process "rot13-filter.pl clean smudge" &&
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
rm -rf repo &&
rm -rf repo &&
mkdir repo &&
mkdir repo &&
(
(
@ -639,7 +639,7 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
IN: smudge test2.r $S2 [OK] -- OUT: $S2 . [OK]
IN: smudge test2.r $S2 [OK] -- OUT: $S2 . [OK]
STOP
STOP
EOF
EOF
test_cmp_exclude_clean expected.log rot13-filter.log &&
test_cmp_exclude_clean expected.log debug.log &&
test_cmp_committed_rot13 "$TEST_ROOT/test.o" test.r &&
test_cmp_committed_rot13 "$TEST_ROOT/test.o" test.r &&
test_cmp_committed_rot13 "$TEST_ROOT/test2.o" test2.r &&
test_cmp_committed_rot13 "$TEST_ROOT/test2.o" test2.r &&
@ -648,7 +648,7 @@ test_expect_success PERL 'process filter should not be restarted if it signals a
'
'
test_expect_success PERL 'process filter abort stops processing of all further files' '
test_expect_success PERL 'process filter abort stops processing of all further files' '
test_config_global filter.protocol.process "rot13-filter.pl clean smudge" &&
test_config_global filter.protocol.process "rot13-filter.pl debug.log clean smudge" &&
rm -rf repo &&
rm -rf repo &&
mkdir repo &&
mkdir repo &&
(
(
@ -676,7 +676,7 @@ test_expect_success PERL 'process filter abort stops processing of all further f
IN: smudge abort.r $SA [OK] -- OUT: 0 [ABORT]
IN: smudge abort.r $SA [OK] -- OUT: 0 [ABORT]
STOP
STOP
EOF
EOF
test_cmp_exclude_clean expected.log rot13-filter.log &&
test_cmp_exclude_clean expected.log debug.log &&
test_cmp "$TEST_ROOT/test.o" test.r &&
test_cmp "$TEST_ROOT/test.o" test.r &&
test_cmp "$TEST_ROOT/test2.o" test2.r &&
test_cmp "$TEST_ROOT/test2.o" test2.r &&