summaryrefslogtreecommitdiff
path: root/commit-graph.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2020-05-01 20:39:54 (GMT)
committerJunio C Hamano <gitster@pobox.com>2020-05-01 20:39:54 (GMT)
commit6d56d4c7dcd667d28aec28498591723c6febea1c (patch)
tree1d583dce7f1063b570c4d18f223c1ec7b9473836 /commit-graph.c
parent9b6606f43d55bbf33b9924d16e02e60e1c09660a (diff)
parent1b4c57fa87e121f155863f898dc39d06cf4a1d99 (diff)
downloadgit-6d56d4c7dcd667d28aec28498591723c6febea1c.zip
git-6d56d4c7dcd667d28aec28498591723c6febea1c.tar.gz
git-6d56d4c7dcd667d28aec28498591723c6febea1c.tar.bz2
Merge branch 'ds/blame-on-bloom'
"git blame" learns to take advantage of the "changed-paths" Bloom filter stored in the commit-graph file. * ds/blame-on-bloom: test-bloom: check that we have expected arguments test-bloom: fix some whitespace issues blame: drop unused parameter from maybe_changed_path blame: use changed-path Bloom filters tests: write commit-graph with Bloom filters revision: complicated pathspecs disable filters
Diffstat (limited to 'commit-graph.c')
-rw-r--r--commit-graph.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/commit-graph.c b/commit-graph.c
index 7eb4f22..6dc777e 100644
--- a/commit-graph.c
+++ b/commit-graph.c
@@ -19,6 +19,20 @@
#include "bloom.h"
#include "commit-slab.h"
+void git_test_write_commit_graph_or_die(void)
+{
+ int flags = 0;
+ if (!git_env_bool(GIT_TEST_COMMIT_GRAPH, 0))
+ return;
+
+ if (git_env_bool(GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS, 0))
+ flags = COMMIT_GRAPH_WRITE_BLOOM_FILTERS;
+
+ if (write_commit_graph_reachable(the_repository->objects->odb,
+ flags, NULL))
+ die("failed to write commit-graph under GIT_TEST_COMMIT_GRAPH");
+}
+
#define GRAPH_SIGNATURE 0x43475048 /* "CGPH" */
#define GRAPH_CHUNKID_OIDFANOUT 0x4f494446 /* "OIDF" */
#define GRAPH_CHUNKID_OIDLOOKUP 0x4f49444c /* "OIDL" */