Skip to content

Commit bb5ce39

Browse files
committed
commit: write commit-graph with bloom filters
The GIT_TEST_COMMIT_GRAPH environment variable updates the commit- graph file whenever "git commit" is run, ensuring that we always have an updated commit-graph throughout the test suite. The GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS environment variable was introduced to write the changed-path Bloom filters whenever "git commit-graph write" is run. However, the GIT_TEST_COMMIT_GRAPH trick doesn't launch a separate process and instead writes it directly. Update the "git commit" builtin to write changed-path Bloom filters when both GIT_TEST_COMMIT_GRAPH and GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS are enabled. Signed-off-by: Derrick Stolee <[email protected]>
1 parent 9cc31c2 commit bb5ce39

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

builtin/commit.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1701,7 +1701,9 @@ int cmd_commit(int argc, const char **argv, const char *prefix)
17011701
"not exceeded, and then \"git restore --staged :/\" to recover."));
17021702

17031703
if (git_env_bool(GIT_TEST_COMMIT_GRAPH, 0) &&
1704-
write_commit_graph_reachable(the_repository->objects->odb, 0, NULL))
1704+
write_commit_graph_reachable(the_repository->objects->odb,
1705+
git_env_bool(GIT_TEST_COMMIT_GRAPH_CHANGED_PATHS, 0) ? COMMIT_GRAPH_WRITE_BLOOM_FILTERS : 0,
1706+
NULL))
17051707
return 1;
17061708

17071709
repo_rerere(the_repository, 0);

0 commit comments

Comments
 (0)