diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-04-25 16:41:15 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-04-25 16:41:15 +0900 |
| commit | a5e4be2f683f48a3edbbf9375af923a8256efb81 (patch) | |
| tree | 500ed45266468c4984a45d2ee9adea053695b48e /commit-graph.h | |
| parent | Merge branch 'ab/gc-reflog' (diff) | |
| parent | commit-graph: improve & i18n error messages (diff) | |
| download | git-a5e4be2f683f48a3edbbf9375af923a8256efb81.tar.gz git-a5e4be2f683f48a3edbbf9375af923a8256efb81.zip | |
Merge branch 'ab/commit-graph-fixes'
Code cleanup with more careful error checking before using data
read from the commit-graph file.
* ab/commit-graph-fixes:
commit-graph: improve & i18n error messages
commit-graph write: don't die if the existing graph is corrupt
commit-graph verify: detect inability to read the graph
commit-graph: don't pass filename to load_commit_graph_one_fd_st()
commit-graph: don't early exit(1) on e.g. "git status"
commit-graph: fix segfault on e.g. "git status"
commit-graph tests: test a graph that's too small
commit-graph tests: split up corrupt_graph_and_verify()
Diffstat (limited to 'commit-graph.h')
| -rw-r--r-- | commit-graph.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/commit-graph.h b/commit-graph.h index 096d8bac34..7dfb8c896f 100644 --- a/commit-graph.h +++ b/commit-graph.h @@ -7,10 +7,12 @@ #include "cache.h" #define GIT_TEST_COMMIT_GRAPH "GIT_TEST_COMMIT_GRAPH" +#define GIT_TEST_COMMIT_GRAPH_DIE_ON_LOAD "GIT_TEST_COMMIT_GRAPH_DIE_ON_LOAD" struct commit; char *get_commit_graph_filename(const char *obj_dir); +int open_commit_graph(const char *graph_file, int *fd, struct stat *st); /* * Given a commit struct, try to fill the commit struct info, including: @@ -52,7 +54,7 @@ struct commit_graph { const unsigned char *chunk_extra_edges; }; -struct commit_graph *load_commit_graph_one(const char *graph_file); +struct commit_graph *load_commit_graph_one_fd_st(int fd, struct stat *st); struct commit_graph *parse_commit_graph(void *graph_map, int fd, size_t graph_size); |
