summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-05-15 11:01:48 -0700
committerJunio C Hamano <gitster@pobox.com>2015-05-15 11:02:49 -0700
commit8884b57b5cf270d0563d91671080cc7f49b7af22 (patch)
treeb050b6ab4374824a40eda62a9867de663994097a
parenta79839dce5115858aa41bcb56f18bc8a9d7b5b04 (diff)
downloadgit-jh/clean-filter-empty.tar.gz
-rwxr-xr-xt/t0021-conversion.sh20
1 files changed, 11 insertions, 9 deletions
diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh
index 6b75567b83..0b77912565 100755
--- a/t/t0021-conversion.sh
+++ b/t/t0021-conversion.sh
@@ -204,15 +204,17 @@ test_expect_success EXPENSIVE 'filter large file' '
! test -s err
'
-test_expect_success "filtering empty file should not produce complaints" '
- echo "emptyfile filter=cat" >>.gitattributes &&
- git config filter.cat.clean cat &&
- git config filter.cat.smudge cat &&
- git add . &&
- git commit -m "cat filter for emptyfile" &&
- > emptyfile &&
- git add emptyfile 2>err &&
- ! grep -Fiqs "bad file descriptor" err
+test_expect_success "filtering empty file should work correctly" '
+ write_script filter-clean.sh <<-EOF &&
+ echo "Extra Head" && cat
+ EOF
+ echo "emptyfile filter=check" >>.gitattributes &&
+ git config filter.check.clean "sh ./filter-clean.sh" &&
+ >emptyfile &&
+ git add emptyfile &&
+ echo "Extra Head" >expect &&
+ git cat-file blob :emptyfile >actual &&
+ test_cmp expect actual
'
test_done