summaryrefslogtreecommitdiff
path: root/commit-graph.h
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2020-02-14 12:54:24 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2020-02-14 12:54:24 -0800
commit53c3be2c29b97a68145d42b413df2f8c070a2084 (patch)
tree18f6572a288c4146d21149fe935810dcd41083d3 /commit-graph.h
parentMerge branch 'jk/index-pack-dupfix' (diff)
parentcommit-graph.h: use odb in 'load_commit_graph_one_fd_st' (diff)
downloadtgif-53c3be2c29b97a68145d42b413df2f8c070a2084.tar.xz
Merge branch 'tb/commit-graph-object-dir'
The code to compute the commit-graph has been taught to use a more robust way to tell if two object directories refer to the same thing. * tb/commit-graph-object-dir: commit-graph.h: use odb in 'load_commit_graph_one_fd_st' commit-graph.c: remove path normalization, comparison commit-graph.h: store object directory in 'struct commit_graph' commit-graph.h: store an odb in 'struct write_commit_graph_context' t5318: don't pass non-object directory to '--object-dir'
Diffstat (limited to 'commit-graph.h')
-rw-r--r--commit-graph.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/commit-graph.h b/commit-graph.h
index 7f5c933fa2..e87a6f6360 100644
--- a/commit-graph.h
+++ b/commit-graph.h
@@ -5,13 +5,14 @@
#include "repository.h"
#include "string-list.h"
#include "cache.h"
+#include "object-store.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);
+char *get_commit_graph_filename(struct object_directory *odb);
int open_commit_graph(const char *graph_file, int *fd, struct stat *st);
/*
@@ -48,7 +49,7 @@ struct commit_graph {
uint32_t num_commits;
struct object_id oid;
char *filename;
- const char *obj_dir;
+ struct object_directory *odb;
uint32_t num_commits_in_base;
struct commit_graph *base_graph;
@@ -60,8 +61,10 @@ struct commit_graph {
const unsigned char *chunk_base_graphs;
};
-struct commit_graph *load_commit_graph_one_fd_st(int fd, struct stat *st);
-struct commit_graph *read_commit_graph_one(struct repository *r, const char *obj_dir);
+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);
@@ -91,10 +94,10 @@ struct split_commit_graph_opts {
* 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,
+int write_commit_graph_reachable(struct object_directory *odb,
enum commit_graph_write_flags flags,
const struct split_commit_graph_opts *split_opts);
-int write_commit_graph(const char *obj_dir,
+int write_commit_graph(struct object_directory *odb,
struct string_list *pack_indexes,
struct string_list *commit_hex,
enum commit_graph_write_flags flags,