test_expect_success 'setup tar filters' '
git config tar.tar.foo.command "tr ab ba" &&
- git config tar.bar.command "tr ab ba"
+ git config tar.bar.command "tr ab ba" &&
+ git config tar.bar.remote true
'
test_expect_success 'archive --list mentions user filter' '
grep "^bar\$" output
'
-test_expect_success 'archive --list shows remote user filters' '
+test_expect_success NOT_MINGW 'archive --list shows only enabled remote filters' '
git archive --list --remote=. >output &&
- grep "^tar\.foo\$" output &&
+ ! grep "^tar\.foo\$" output &&
grep "^bar\$" output
'
test_cmp b.tar config-implicittar.foo
'
+test_expect_success NOT_MINGW 'only enabled filters are available remotely' '
+ test_must_fail git archive --remote=. --format=tar.foo HEAD \
+ >remote.tar.foo &&
+ git archive --remote=. --format=bar >remote.bar HEAD &&
+ test_cmp remote.bar config.bar
+'
+
if $GZIP --version >/dev/null 2>&1; then
test_set_prereq GZIP
else
test_cmp b.tar j.tar
'
+test_expect_success GZIP,NOT_MINGW 'remote tar.gz is allowed by default' '
+ git archive --remote=. --format=tar.gz HEAD >remote.tar.gz &&
+ test_cmp j.tgz remote.tar.gz
+'
+
+test_expect_success GZIP,NOT_MINGW 'remote tar.gz can be disabled' '
+ git config tar.tar.gz.remote false &&
+ test_must_fail git archive --remote=. --format=tar.gz HEAD \
+ >remote.tar.gz
+'
+
test_done