mirror of
https://github.com/git/git.git
synced 2025-12-12 20:36:24 +01:00
pack-revindex: introduce GIT_TEST_REV_INDEX_DIE_ON_DISK
Inec8e7760ac(pack-revindex: ensure that on-disk reverse indexes are given precedence, 2021-01-25), we introduced GIT_TEST_REV_INDEX_DIE_IN_MEMORY to abort the process when Git generated a reverse index from scratch.ec8e7760acwas about ensuring that Git prefers a .rev file when available over generating the same information in memory from scratch. In a subsequent patch, we'll introduce `pack.readReverseIndex`, which may be used to disable reading ".rev" files when available. In order to ensure that those files are indeed being ignored, introduce an analogous option to abort the process when Git reads a ".rev" file from disk. Signed-off-by: Taylor Blau <me@ttaylorr.com> Acked-by: Derrick Stolee <derrickstolee@github.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
committed by
Junio C Hamano
parent
65308ad8f7
commit
2a250d6165
@@ -205,6 +205,9 @@ static int load_revindex_from_disk(char *revindex_name,
|
||||
size_t revindex_size;
|
||||
struct revindex_header *hdr;
|
||||
|
||||
if (git_env_bool(GIT_TEST_REV_INDEX_DIE_ON_DISK, 0))
|
||||
die("dying as requested by '%s'", GIT_TEST_REV_INDEX_DIE_ON_DISK);
|
||||
|
||||
fd = git_open(revindex_name);
|
||||
|
||||
if (fd < 0) {
|
||||
|
||||
Reference in New Issue
Block a user