From: Junio C Hamano Date: Wed, 18 Sep 2019 22:21:51 +0000 (-0700) Subject: Merge branch 'ds/commit-graph-on-fetch' into next X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=10702dd9890c148ecf5154e216598b3a4273e57e;p=git Merge branch 'ds/commit-graph-on-fetch' into next A configuration variable tells "git fetch" to write the commit graph after finishing. * ds/commit-graph-on-fetch: fetch: add fetch.writeCommitGraph config setting --- 10702dd9890c148ecf5154e216598b3a4273e57e diff --cc builtin/fetch.c index 9b27ae9681,d36a403859..67c0eb88c6 --- a/builtin/fetch.c +++ b/builtin/fetch.c @@@ -23,8 -23,7 +23,9 @@@ #include "packfile.h" #include "list-objects-filter-options.h" #include "commit-reach.h" +#include "branch.h" +#include "promisor-remote.h" + #include "commit-graph.h" #define FORCED_UPDATES_DELAY_WARNING_IN_MS (10 * 1000) @@@ -1759,6 -1716,20 +1760,20 @@@ int cmd_fetch(int argc, const char **ar string_list_clear(&list, 0); + prepare_repo_settings(the_repository); + if (the_repository->settings.fetch_write_commit_graph) { - int commit_graph_flags = COMMIT_GRAPH_SPLIT; ++ int commit_graph_flags = COMMIT_GRAPH_WRITE_SPLIT; + struct split_commit_graph_opts split_opts; + memset(&split_opts, 0, sizeof(struct split_commit_graph_opts)); + + if (progress) - commit_graph_flags |= COMMIT_GRAPH_PROGRESS; ++ commit_graph_flags |= COMMIT_GRAPH_WRITE_PROGRESS; + + write_commit_graph_reachable(get_object_directory(), + commit_graph_flags, + &split_opts); + } + close_object_store(the_repository->objects); if (enable_auto_gc) {