Skip to content

Commit 2a983b2

Browse files
committed
Merge branch 'mh/import-transport-fd-fix'
The ownership rule for the file descriptor to fast-import remote backend was mixed up, leading to unrelated file descriptor getting closed, which has been fixed. * mh/import-transport-fd-fix: Use xmmap_gently instead of xmmap in use_pack dup() the input fd for fast-import used for remote helpers
2 parents 813a3a2 + 3203566 commit 2a983b2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

packfile.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ unsigned char *use_pack(struct packed_git *p,
640640
while (packed_git_limit < pack_mapped
641641
&& unuse_one_window(p))
642642
; /* nothing */
643-
win->base = xmmap(NULL, win->len,
643+
win->base = xmmap_gently(NULL, win->len,
644644
PROT_READ, MAP_PRIVATE,
645645
p->pack_fd, win->offset);
646646
if (win->base == MAP_FAILED)

transport-helper.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -423,7 +423,7 @@ static int get_importer(struct transport *transport, struct child_process *fasti
423423
struct helper_data *data = transport->data;
424424
int cat_blob_fd, code;
425425
child_process_init(fastimport);
426-
fastimport->in = helper->out;
426+
fastimport->in = xdup(helper->out);
427427
argv_array_push(&fastimport->args, "fast-import");
428428
argv_array_push(&fastimport->args, debug ? "--stats" : "--quiet");
429429

0 commit comments

Comments
 (0)