summaryrefslogtreecommitdiffstats
path: root/pack-revindex.h
diff options
context:
space:
mode:
authorTaylor Blau <me@ttaylorr.com>2021-01-25 18:37:46 -0500
committerJunio C Hamano <gitster@pobox.com>2021-01-25 18:32:44 -0800
commitec8e7760ac38ef426f87ec738454e574be53a00e (patch)
tree03da0ca6bab1e384f5a2823705de6fa97f71938d /pack-revindex.h
parentt: support GIT_TEST_WRITE_REV_INDEX (diff)
downloadgit-ec8e7760ac38ef426f87ec738454e574be53a00e.tar.xz
git-ec8e7760ac38ef426f87ec738454e574be53a00e.zip
pack-revindex: ensure that on-disk reverse indexes are given precedence
When an on-disk reverse index exists, there is no need to generate one in memory. In fact, doing so can be slow, and require large amounts of the heap. Let's make sure that we treat the on-disk reverse index with precedence (i.e., that when it exists, we don't bother trying to generate an equivalent one in memory) by teaching Git how to conditionally die() when generating a reverse index in memory. Then, add a test to ensure that when (a) an on-disk reverse index exists, and (b) when setting GIT_TEST_REV_INDEX_DIE_IN_MEMORY, that we do not die, implying that we read from the on-disk one. Signed-off-by: Taylor Blau <me@ttaylorr.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-revindex.h')
-rw-r--r--pack-revindex.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/pack-revindex.h b/pack-revindex.h
index d1a0595e892..ba7c82c1251 100644
--- a/pack-revindex.h
+++ b/pack-revindex.h
@@ -21,6 +21,7 @@
#define RIDX_VERSION 1
#define GIT_TEST_WRITE_REV_INDEX "GIT_TEST_WRITE_REV_INDEX"
+#define GIT_TEST_REV_INDEX_DIE_IN_MEMORY "GIT_TEST_REV_INDEX_DIE_IN_MEMORY"
struct packed_git;