summaryrefslogtreecommitdiff
path: root/fetch-pack.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-12-10 22:35:12 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-12-10 22:35:12 (GMT)
commit353a27ad95b726e650b5782a1056c4ca81992efb (patch)
tree3446433f5ad224ddeccb1985e3cf47a26ee096eb /fetch-pack.c
parent85ac30ff5c581587f04c9e939dea95b292c9cecb (diff)
parent2a4aed42ecf6ee4ba8824423bd40010c3572aa0c (diff)
downloadgit-353a27ad95b726e650b5782a1056c4ca81992efb.zip
git-353a27ad95b726e650b5782a1056c4ca81992efb.tar.gz
git-353a27ad95b726e650b5782a1056c4ca81992efb.tar.bz2
Merge branch 'jk/fetch-pack-avoid-sigpipe-to-index-pack'
"git fetch", when received a bad packfile, can fail with SIGPIPE. This wasn't wrong per-se, but we now detect the situation and fail in a more predictable way. * jk/fetch-pack-avoid-sigpipe-to-index-pack: fetch-pack: ignore SIGPIPE when writing to index-pack
Diffstat (limited to 'fetch-pack.c')
-rw-r--r--fetch-pack.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/fetch-pack.c b/fetch-pack.c
index 8b8c75f..34987a2 100644
--- a/fetch-pack.c
+++ b/fetch-pack.c
@@ -25,6 +25,7 @@
#include "shallow.h"
#include "commit-reach.h"
#include "commit-graph.h"
+#include "sigchain.h"
static int transfer_unpack_limit = -1;
static int fetch_unpack_limit = -1;
@@ -956,6 +957,8 @@ static int get_pack(struct fetch_pack_args *args,
strvec_push(index_pack_args, cmd.args.v[i]);
}
+ sigchain_push(SIGPIPE, SIG_IGN);
+
cmd.in = demux.out;
cmd.git_cmd = 1;
if (start_command(&cmd))
@@ -986,6 +989,8 @@ static int get_pack(struct fetch_pack_args *args,
if (use_sideband && finish_async(&demux))
die(_("error in sideband demultiplexer"));
+ sigchain_pop(SIGPIPE);
+
/*
* Now that index-pack has succeeded, write the promisor file using the
* obtained .keep filename if necessary