diff --git a/convert.c b/convert.c index 814e814438..02d5f1e23c 100644 --- a/convert.c +++ b/convert.c @@ -395,7 +395,7 @@ static int apply_filter(const char *path, const char *src, size_t len, int fd, struct async async; struct filter_params params; - if (!cmd) + if (!cmd || !*cmd) return 0; if (!dst) diff --git a/t/t0021-conversion.sh b/t/t0021-conversion.sh index 718efa04d3..7bac2bcf26 100755 --- a/t/t0021-conversion.sh +++ b/t/t0021-conversion.sh @@ -252,4 +252,20 @@ test_expect_success "filter: smudge empty file" ' test_cmp expected filtered-empty-in-repo ' +test_expect_success 'disable filter with empty override' ' + test_config_global filter.disable.smudge false && + test_config_global filter.disable.clean false && + test_config filter.disable.smudge false && + test_config filter.disable.clean false && + + echo "*.disable filter=disable" >.gitattributes && + + echo test >test.disable && + git -c filter.disable.clean= add test.disable 2>err && + test_must_be_empty err && + rm -f test.disable && + git -c filter.disable.smudge= checkout -- test.disable 2>err && + test_must_be_empty err +' + test_done