]> git.ipfire.org Git - thirdparty/git.git/commitdiff
send-pack: kill pack-objects helper on signal or exit
authorJeff King <peff@peff.net>
Sat, 21 Nov 2020 00:29:21 +0000 (19:29 -0500)
committerJunio C Hamano <gitster@pobox.com>
Sat, 21 Nov 2020 21:55:17 +0000 (13:55 -0800)
We spawn an external pack-objects process to actually send
objects to the remote side. If we are killed by a signal
during this process, the pack-objects will keep running and
complete the push, which may surprise the user. We should
take it down when we go down.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
send-pack.c

index c9698070fca18e403add1576ae9e1d0e818e16e7..2b3d15be5a1e3c8fc1eaf85d18b886999e19000c 100644 (file)
@@ -85,6 +85,7 @@ static int pack_objects(int fd, struct ref *refs, struct oid_array *extra, struc
        po.in = -1;
        po.out = args->stateless_rpc ? -1 : fd;
        po.git_cmd = 1;
+       po.clean_on_exit = 1;
        if (start_command(&po))
                die_errno("git pack-objects failed");