diff options
| author | Junio C Hamano <gitster@pobox.com> | 2019-07-09 15:25:36 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2019-07-09 15:25:36 -0700 |
| commit | e1168940ce11878261ece4602a7d8b8ee9a8c77e (patch) | |
| tree | 167523cf6bc8dd4f070c275febb228da7bc84177 /commit-graph.h | |
| parent | Merge branch 'sg/trace2-rename' (diff) | |
| parent | commit-graph: extract write_commit_graph_file() (diff) | |
| download | git-e1168940ce11878261ece4602a7d8b8ee9a8c77e.tar.gz git-e1168940ce11878261ece4602a7d8b8ee9a8c77e.zip | |
Merge branch 'ds/commit-graph-write-refactor'
Renamed from commit-graph-format-v2 and changed scope.
* ds/commit-graph-write-refactor:
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 | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/commit-graph.h b/commit-graph.h index 7dfb8c896f..01538b5cf5 100644 --- a/commit-graph.h +++ b/commit-graph.h @@ -65,12 +65,20 @@ 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); |
