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
This commit is contained in:
@ -25,6 +25,7 @@
|
|||||||
#include "shallow.h"
|
#include "shallow.h"
|
||||||
#include "commit-reach.h"
|
#include "commit-reach.h"
|
||||||
#include "commit-graph.h"
|
#include "commit-graph.h"
|
||||||
|
#include "sigchain.h"
|
||||||
|
|
||||||
static int transfer_unpack_limit = -1;
|
static int transfer_unpack_limit = -1;
|
||||||
static int fetch_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]);
|
strvec_push(index_pack_args, cmd.args.v[i]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
sigchain_push(SIGPIPE, SIG_IGN);
|
||||||
|
|
||||||
cmd.in = demux.out;
|
cmd.in = demux.out;
|
||||||
cmd.git_cmd = 1;
|
cmd.git_cmd = 1;
|
||||||
if (start_command(&cmd))
|
if (start_command(&cmd))
|
||||||
@ -986,6 +989,8 @@ static int get_pack(struct fetch_pack_args *args,
|
|||||||
if (use_sideband && finish_async(&demux))
|
if (use_sideband && finish_async(&demux))
|
||||||
die(_("error in sideband demultiplexer"));
|
die(_("error in sideband demultiplexer"));
|
||||||
|
|
||||||
|
sigchain_pop(SIGPIPE);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Now that index-pack has succeeded, write the promisor file using the
|
* Now that index-pack has succeeded, write the promisor file using the
|
||||||
* obtained .keep filename if necessary
|
* obtained .keep filename if necessary
|
||||||
|
Reference in New Issue
Block a user