diff options
author | Junio C Hamano <gitster@pobox.com> | 2020-05-01 23:39:54 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2020-05-01 23:39:54 +0300 |
commit | 6d56d4c7dcd667d28aec28498591723c6febea1c (patch) | |
tree | 1d583dce7f1063b570c4d18f223c1ec7b9473836 /commit-graph.c | |
parent | 9b6606f43d55bbf33b9924d16e02e60e1c09660a (diff) | |
parent | 1b4c57fa87e121f155863f898dc39d06cf4a1d99 (diff) |
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.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/commit-graph.c b/commit-graph.c index 7eb4f22f00..6dc777e2f3 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" */ |