diff options
author | Derrick Stolee <dstolee@microsoft.com> | 2018-09-13 11:02:13 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-09-17 13:49:38 -0700 |
commit | 56ee7ff15655fa1c9a1368ddd717fc84556359bc (patch) | |
tree | d5aba233c33b1a11faac323eb97de0d33e3f84e6 /midx.c | |
parent | 6a22d521260f86dff8fe6f23ab329cebb62ba4f0 (diff) | |
download | git-56ee7ff15655fa1c9a1368ddd717fc84556359bc.tar.gz |
multi-pack-index: add 'verify' verb
The multi-pack-index builtin writes multi-pack-index files, and
uses a 'write' verb to do so. Add a 'verify' verb that checks this
file matches the contents of the pack-indexes it replaces.
The current implementation is a no-op, but will be extended in
small increments in later commits.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'midx.c')
-rw-r--r-- | midx.c | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -928,3 +928,16 @@ void clear_midx_file(const char *object_dir) free(midx); } + +static int verify_midx_error; + +int verify_midx_file(const char *object_dir) +{ + struct multi_pack_index *m = load_multi_pack_index(object_dir, 1); + verify_midx_error = 0; + + if (!m) + return 0; + + return verify_midx_error; +} |