]> git.ipfire.org Git - thirdparty/git.git/commitdiff
bloom: ignore renames when computing changed paths
authorDerrick Stolee <dstolee@microsoft.com>
Thu, 9 Apr 2020 13:00:11 +0000 (13:00 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Apr 2020 18:04:35 +0000 (11:04 -0700)
The changed-path Bloom filters record an entry in the filter for
every path that was changed. This includes every add and delete,
regardless of whether a rename was detected. Detecting renames
causes significant performance issues, but also will trigger
downloading missing blobs in partial clone.

The simple fix is to disable rename detection when computing a
changed-path Bloom filter. This should already be disabled by
default, but it is good to explicitly enforce the intended
behavior.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
bloom.c

diff --git a/bloom.c b/bloom.c
index c5b461d1cfe58fc681e6156ce5d06718de22f87d..dd9bab9bbd6cfd6b71a39e73813ecf745bec835e 100644 (file)
--- a/bloom.c
+++ b/bloom.c
@@ -189,6 +189,7 @@ struct bloom_filter *get_bloom_filter(struct repository *r,
 
        repo_diff_setup(r, &diffopt);
        diffopt.flags.recursive = 1;
+       diffopt.detect_rename = 0;
        diffopt.max_changes = max_changes;
        diff_setup_done(&diffopt);