diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-07-29 12:38:22 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-07-29 12:38:22 -0700 |
| commit | dea6737bb76ba231474668a804d3f7178b766c47 (patch) | |
| tree | 4b021361d48fcd82cfb80124bde0b25aa1c2884d /commit-graph.h | |
| parent | Merge branch 'pw/add-p-recount' into maint (diff) | |
| parent | packfile: rename close_all_packs to close_object_store (diff) | |
| download | git-dea6737bb76ba231474668a804d3f7178b766c47.tar.gz git-dea6737bb76ba231474668a804d3f7178b766c47.zip | |
Merge branch 'ds/close-object-store' into maint
The commit-graph file is now part of the "files that the runtime
may keep open file descriptors on, all of which would need to be
closed when done with the object store", and the file descriptor to
an existing commit-graph file now is closed before "gc" finalizes a
new instance to replace it.
* ds/close-object-store:
packfile: rename close_all_packs to close_object_store
packfile: close commit-graph in close_all_packs
commit-graph: use raw_object_store when closing
commit-graph: extract write_commit_graph_file()
commit-graph: extract copy_oids_to_commits()
commit-graph: extract count_distinct_commits()
commit-graph: extract fill_oids_from_all_packs()
commit-graph: extract fill_oids_from_commit_hex()
commit-graph: extract fill_oids_from_packs()
commit-graph: create write_commit_graph_context
commit-graph: remove Future Work section
commit-graph: collapse parameters into flags
commit-graph: return with errors during write
commit-graph: fix the_repository reference
Diffstat (limited to 'commit-graph.h')
| -rw-r--r-- | commit-graph.h | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/commit-graph.h b/commit-graph.h index 7dfb8c896f..390c7f6961 100644 --- a/commit-graph.h +++ b/commit-graph.h @@ -65,16 +65,24 @@ struct commit_graph *parse_commit_graph(void *graph_map, int fd, */ int generation_numbers_enabled(struct repository *r); -void write_commit_graph_reachable(const char *obj_dir, int append, - int report_progress); -void write_commit_graph(const char *obj_dir, - struct string_list *pack_indexes, - struct string_list *commit_hex, - int append, int report_progress); +#define COMMIT_GRAPH_APPEND (1 << 0) +#define COMMIT_GRAPH_PROGRESS (1 << 1) + +/* + * The write_commit_graph* methods return zero on success + * and a negative value on failure. Note that if the repository + * is not compatible with the commit-graph feature, then the + * methods will return 0 without writing a commit-graph. + */ +int write_commit_graph_reachable(const char *obj_dir, unsigned int flags); +int write_commit_graph(const char *obj_dir, + struct string_list *pack_indexes, + struct string_list *commit_hex, + unsigned int flags); int verify_commit_graph(struct repository *r, struct commit_graph *g); -void close_commit_graph(struct repository *); +void close_commit_graph(struct raw_object_store *); void free_commit_graph(struct commit_graph *); #endif |
