summaryrefslogtreecommitdiff
path: root/commit-graph.h
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2020-04-23 21:41:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-04-25 05:25:50 (GMT)
commitc8828530b7797f5ab584c84dc2b86d3c14b39c8d (patch)
tree1b90f0518485d0547f6654429b1c8780cf187ece /commit-graph.h
parentb78a556a6aef0d1406e0038f6cb8401f0282fa98 (diff)
downloadgit-c8828530b7797f5ab584c84dc2b86d3c14b39c8d.zip
git-c8828530b7797f5ab584c84dc2b86d3c14b39c8d.tar.gz
git-c8828530b7797f5ab584c84dc2b86d3c14b39c8d.tar.bz2
commit-graph: close descriptors after mmap
We don't ever refer to the descriptor after mmap-ing it. And keeping it open means we can run out of descriptors in degenerate cases (e.g., thousands of split chain files). Let's close it as soon as possible. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.h')
-rw-r--r--commit-graph.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/commit-graph.h b/commit-graph.h
index 98ef121..1254eae 100644
--- a/commit-graph.h
+++ b/commit-graph.h
@@ -40,8 +40,6 @@ struct tree *get_commit_tree_in_graph(struct repository *r,
const struct commit *c);
struct commit_graph {
- int graph_fd;
-
const unsigned char *data;
size_t data_len;
@@ -66,8 +64,7 @@ struct commit_graph *load_commit_graph_one_fd_st(int fd, struct stat *st,
struct object_directory *odb);
struct commit_graph *read_commit_graph_one(struct repository *r,
struct object_directory *odb);
-struct commit_graph *parse_commit_graph(void *graph_map, int fd,
- size_t graph_size);
+struct commit_graph *parse_commit_graph(void *graph_map, size_t graph_size);
/*
* Return 1 if and only if the repository has a commit-graph