summaryrefslogtreecommitdiff
path: root/commit-graph.c
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2019-06-12 13:29:38 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-06-12 18:20:53 (GMT)
commit5af803945212af875670582ff153ee05ec368b83 (patch)
tree8bb9b6ccb72fc7f8024428991eabf07c31554f68 /commit-graph.c
parente103f7276f0d809c2935ebc1a3d68c6bbfaed23d (diff)
downloadgit-5af803945212af875670582ff153ee05ec368b83.zip
git-5af803945212af875670582ff153ee05ec368b83.tar.gz
git-5af803945212af875670582ff153ee05ec368b83.tar.bz2
commit-graph: collapse parameters into flags
The write_commit_graph() and write_commit_graph_reachable() methods currently take two boolean parameters: 'append' and 'report_progress'. As we update these methods, adding more parameters this way becomes cluttered and hard to maintain. Collapse these parameters into a 'flags' parameter, and adjust the callers to provide flags as necessary. Signed-off-by: Derrick Stolee <dstolee@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'commit-graph.c')
-rw-r--r--commit-graph.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/commit-graph.c b/commit-graph.c
index 1b58d1d..fc40b53 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -851,15 +851,14 @@ static int add_ref_to_list(const char *refname,
return 0;
}
-int write_commit_graph_reachable(const char *obj_dir, int append,
- int report_progress)
+int write_commit_graph_reachable(const char *obj_dir, unsigned int flags)
{
struct string_list list = STRING_LIST_INIT_DUP;
int result;
for_each_ref(add_ref_to_list, &list);
result = write_commit_graph(obj_dir, NULL, &list,
- append, report_progress);
+ flags);
string_list_clear(&list, 0);
return result;
@@ -868,7 +867,7 @@ int write_commit_graph_reachable(const char *obj_dir, int append,
int write_commit_graph(const char *obj_dir,
struct string_list *pack_indexes,
struct string_list *commit_hex,
- int append, int report_progress)
+ unsigned int flags)
{
struct packed_oid_list oids;
struct packed_commit_list commits;
@@ -887,6 +886,8 @@ int write_commit_graph(const char *obj_dir,
struct strbuf progress_title = STRBUF_INIT;
unsigned long approx_nr_objects;
int res = 0;
+ int append = flags & COMMIT_GRAPH_APPEND;
+ int report_progress = flags & COMMIT_GRAPH_PROGRESS;
if (!commit_graph_compatible(the_repository))
return 0;