aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2022-11-08 17:15:09 -0500
committerTaylor Blau <me@ttaylorr.com>2022-11-08 17:15:09 -0500
commit3e9303dc8e7c5798b5b83f1c1dfccb875db06b29 (patch)
tree73c32c654dc74c341bee74388b199335511fad2a
parentMerge branch 'ma/drop-redundant-diagnostic' (diff)
parentarchive-tar: report filter start error only once (diff)
downloadgit-3e9303dc8e7c5798b5b83f1c1dfccb875db06b29.tar.gz
git-3e9303dc8e7c5798b5b83f1c1dfccb875db06b29.zip
Merge branch 'rs/archive-filter-error-once'
"git archive" mistakenly complained twice about a missing executable, which has been corrected. * rs/archive-filter-error-once: archive-tar: report filter start error only once
-rw-r--r--archive-tar.c1
-rwxr-xr-xt/t5000-tar-tree.sh7
2 files changed, 8 insertions, 0 deletions
diff --git a/archive-tar.c b/archive-tar.c
index 3e4822b684..f8fad2946e 100644
--- a/archive-tar.c
+++ b/archive-tar.c
@@ -498,6 +498,7 @@ static int write_tar_filter_archive(const struct archiver *ar,
strvec_push(&filter.args, cmd.buf);
filter.use_shell = 1;
filter.in = -1;
+ filter.silent_exec_failure = 1;
if (start_command(&filter) < 0)
die_errno(_("unable to start '%s' filter"), cmd.buf);
diff --git a/t/t5000-tar-tree.sh b/t/t5000-tar-tree.sh
index eaa0b22ece..d473048138 100755
--- a/t/t5000-tar-tree.sh
+++ b/t/t5000-tar-tree.sh
@@ -342,6 +342,13 @@ test_expect_success 'only enabled filters are available remotely' '
test_cmp_bin remote.bar config.bar
'
+test_expect_success 'invalid filter is reported only once' '
+ test_must_fail git -c tar.invalid.command= archive --format=invalid \
+ HEAD >out 2>err &&
+ test_must_be_empty out &&
+ test_line_count = 1 err
+'
+
test_expect_success 'git archive --format=tgz' '
git archive --format=tgz HEAD >j.tgz
'