diff options
author | Junio C Hamano <gitster@pobox.com> | 2019-07-25 14:27:07 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-07-25 14:27:07 -0700 |
commit | dae29547c9f0a4895f02d3ba21dc93a7b666e830 (patch) | |
tree | eb374eff4167a7573077ea7e58ecd63f9d876b7d | |
parent | Merge branch 'nd/corrupt-worktrees' into maint (diff) | |
parent | Use xmmap_gently instead of xmmap in use_pack (diff) | |
download | tgif-dae29547c9f0a4895f02d3ba21dc93a7b666e830.tar.xz |
Merge branch 'mh/import-transport-fd-fix' into maint
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
-rw-r--r-- | packfile.c | 2 | ||||
-rw-r--r-- | transport-helper.c | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/packfile.c b/packfile.c index 49c8544ff4..d786ec7312 100644 --- a/packfile.c +++ b/packfile.c @@ -640,7 +640,7 @@ unsigned char *use_pack(struct packed_git *p, while (packed_git_limit < pack_mapped && unuse_one_window(p)) ; /* nothing */ - win->base = xmmap(NULL, win->len, + win->base = xmmap_gently(NULL, win->len, PROT_READ, MAP_PRIVATE, p->pack_fd, win->offset); if (win->base == MAP_FAILED) diff --git a/transport-helper.c b/transport-helper.c index cec83bd663..c7e17ec9cb 100644 --- a/transport-helper.c +++ b/transport-helper.c @@ -423,7 +423,7 @@ static int get_importer(struct transport *transport, struct child_process *fasti struct helper_data *data = transport->data; int cat_blob_fd, code; child_process_init(fastimport); - fastimport->in = helper->out; + fastimport->in = xdup(helper->out); argv_array_push(&fastimport->args, "fast-import"); argv_array_push(&fastimport->args, debug ? "--stats" : "--quiet"); |