Skip to content

Commit e9c1a3a

Browse files
committed
Merge branch 'js/maint-send-pack-stateless-rpc-deadlock-fix'
* js/maint-send-pack-stateless-rpc-deadlock-fix: send-pack: unbreak push over stateless rpc send-pack: avoid deadlock when pack-object dies early
2 parents df54e2b + 80b5b69 commit e9c1a3a

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

builtin/send-pack.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,9 @@ static void print_helper_status(struct ref *ref)
229229
static int sideband_demux(int in, int out, void *data)
230230
{
231231
int *fd = data;
232+
#ifdef NO_PTHREADS
233+
close(fd[1]);
234+
#endif
232235
int ret = recv_sideband("send-pack", fd[0], out);
233236
close(out);
234237
return ret;
@@ -339,6 +342,8 @@ int send_pack(struct send_pack_args *args,
339342
if (pack_objects(out, remote_refs, extra_have, args) < 0) {
340343
for (ref = remote_refs; ref; ref = ref->next)
341344
ref->status = REF_STATUS_NONE;
345+
if (args->stateless_rpc)
346+
close(out);
342347
if (use_sideband)
343348
finish_async(&demux);
344349
return -1;

0 commit comments

Comments
 (0)