summaryrefslogtreecommitdiff
path: root/builtin/fetch.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2019-09-30 04:19:32 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-09-30 04:19:32 (GMT)
commit5a5350940bd5407968b158c0059938fa5cc0860e (patch)
tree590d09862ea1657b53b4abb7d75da597ed380aad /builtin/fetch.c
parent974bdb02058a82b57bcfebe184f57ebe74eecac5 (diff)
parent50f26bd035816c2bb79582b834d59b49292502a9 (diff)
downloadgit-5a5350940bd5407968b158c0059938fa5cc0860e.zip
git-5a5350940bd5407968b158c0059938fa5cc0860e.tar.gz
git-5a5350940bd5407968b158c0059938fa5cc0860e.tar.bz2
Merge branch 'ds/commit-graph-on-fetch'
A configuration variable tells "git fetch" to write the commit graph after finishing. * ds/commit-graph-on-fetch: fetch: add fetch.writeCommitGraph config setting
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 9b27ae9..67c0eb8 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -25,6 +25,7 @@
#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 +1760,20 @@ int cmd_fetch(int argc, const char **argv, const char *prefix)
string_list_clear(&list, 0);
+ prepare_repo_settings(the_repository);
+ if (the_repository->settings.fetch_write_commit_graph) {
+ 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_WRITE_PROGRESS;
+
+ write_commit_graph_reachable(get_object_directory(),
+ commit_graph_flags,
+ &split_opts);
+ }
+
close_object_store(the_repository->objects);
if (enable_auto_gc) {