git/t/helper
Taylor Blau b80236d0e3 midx: support reading incremental MIDX chains
Now that the MIDX machinery's internals have been taught to understand
incremental MIDXs over the previous handful of commits, the MIDX
machinery itself can begin reading incremental MIDXs.

(Note that while the on-disk format for incremental MIDXs has been
defined, the writing end has not been implemented. This will take place
in the commit after next.)

The core of this change involves following the order specified in the
MIDX chain in reverse and opening up MIDXs in the chain one-by-one,
adding them to the previous layer's `->base_midx` pointer at each step.

In order to implement this, the `load_multi_pack_index()` function is
taught to call a new `load_multi_pack_index_chain()` function if loading
a non-incremental MIDX failed via `load_multi_pack_index_one()`.

When loading a MIDX chain, `load_midx_chain_fd_st()` reads each line in
the file one-by-one and dispatches calls to
`load_multi_pack_index_one()` to read each layer of the MIDX chain. When
a layer was successfully read, it is added to the MIDX chain by calling
`add_midx_to_chain()` which validates the contents of the `BASE` chunk,
performs some bounds checks on the number of combined packs and objects,
and attaches the new MIDX by assigning its `base_midx` pointer to the
existing part of the chain.

As a supplement to this, introduce a new mode in the test-read-midx
test-tool which allows us to read the information for a specific MIDX in
the chain by specifying its trailing checksum via the command-line
arguments like so:

    $ test-tool read-midx .git/objects [checksum]

Signed-off-by: Taylor Blau <me@ttaylorr.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2024-08-06 12:01:38 -07:00
..
.gitignore
test-advise.c
test-bitmap.c Merge branch 'ps/use-the-repository' 2024-07-02 09:59:00 -07:00
test-bloom.c Merge branch 'tb/path-filter-fix' 2024-07-08 14:53:10 -07:00
test-bundle-uri.c remote: drop checks for zero-url case 2024-06-14 09:34:39 -07:00
test-cache-tree.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-chmtime.c
test-config.c
test-crontab.c
test-csprng.c
test-date.c
test-delete-gpgsig.c
test-delta.c
test-dir-iterator.c
test-drop-caches.c
test-dump-cache-tree.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-dump-fsmonitor.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-dump-split-index.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-dump-untracked-cache.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-env-helper.c
test-example-tap.c t0080: turn t-basic unit test into a helper 2024-05-06 14:06:34 -07:00
test-fake-ssh.c
test-find-pack.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-fsmonitor-client.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-genrandom.c
test-genzeros.c
test-getcwd.c
test-hash-speed.c hash-ll: merge with "hash.h" 2024-06-14 10:26:33 -07:00
test-hash.c
test-hashmap.c global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
test-hexdump.c
test-json-writer.c global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
test-lazy-init-name-hash.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-match-trees.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-mergesort.c
test-mktemp.c
test-oid-array.c t/helper: fix segfault in "oid-array" command without repository 2024-06-14 10:26:34 -07:00
test-online-cpus.c
test-pack-mtimes.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-parse-options.c parse-options: fix leaks for users of OPT_FILENAME 2024-06-11 13:15:04 -07:00
test-parse-pathspec-file.c
test-partial-clone.c t/helper: use correct object hash in partial-clone helper 2024-06-14 10:26:34 -07:00
test-path-utils.c Merge branch 'fixes/2.45.1/2.41' into fixes/2.45.1/2.42 2024-05-24 16:57:43 -07:00
test-pcre2-config.c
test-pkt-line.c
test-proc-receive.c t/helper: remove dependency on `the_repository` in "proc-receive" 2024-06-14 10:26:35 -07:00
test-progress.c
test-reach.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-read-cache.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-read-graph.c Merge branch 'tb/path-filter-fix' 2024-07-08 14:53:10 -07:00
test-read-midx.c midx: support reading incremental MIDX chains 2024-08-06 12:01:38 -07:00
test-ref-store.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-reftable.c t: move reftable/record_test.c to the unit testing framework 2024-07-02 08:12:24 -07:00
test-regex.c global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
test-repository.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-revision-walking.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-rot13-filter.c global: improve const correctness when assigning string constants 2024-06-07 10:30:48 -07:00
test-run-command.c test-tool run-command testsuite: support unit tests 2024-05-06 14:06:34 -07:00
test-scrap-cache-tree.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-serve-v2.c
test-sha1.c hash-ll: merge with "hash.h" 2024-06-14 10:26:33 -07:00
test-sha1.sh
test-sha256.c hash-ll: merge with "hash.h" 2024-06-14 10:26:33 -07:00
test-sigchain.c
test-simple-ipc.c
test-string-list.c
test-submodule-config.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-submodule-nested-repo-config.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-submodule.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-subprocess.c
test-tool-utils.h
test-tool.c t: migrate helper/test-oidmap.c to unit-tests/t-oidmap.c 2024-07-03 09:12:14 -07:00
test-tool.h t: migrate helper/test-oidmap.c to unit-tests/t-oidmap.c 2024-07-03 09:12:14 -07:00
test-trace2.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-truncate.c
test-urlmatch-normalization.c
test-userdiff.c
test-wildmatch.c
test-windows-named-pipe.c
test-write-cache.c global: introduce `USE_THE_REPOSITORY_VARIABLE` macro 2024-06-14 10:26:33 -07:00
test-xml-encode.c