aboutsummaryrefslogtreecommitdiffstats
path: root/midx.c
diff options
context:
space:
mode:
authorDerrick Stolee <dstolee@microsoft.com>2018-09-13 11:02:18 -0700
committerJunio C Hamano <gitster@pobox.com>2018-09-17 13:49:41 -0700
commit8e72a3c321eb70caad036e45664de9ea10839b93 (patch)
tree3539133833d736f97223f0f7dbd8c0db02053271 /midx.c
parentd3f8e211700c6c38f905a7d7ab1338df4784c79d (diff)
downloadgit-8e72a3c321eb70caad036e45664de9ea10839b93.tar.gz
multi-pack-index: verify packname order
The final check we make while loading a multi-pack-index is that the packfile names are in lexicographical order. Make this error be a die() instead. In order to test this condition, we need multiple packfiles. Earlier in t5319-multi-pack-index.sh, we tested the interaction with 'git repack' but this limits us to one packfile in our object dir. Move these repack tests until after the 'verify' tests. 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.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/midx.c b/midx.c
index 9e43216d09..939e8fa391 100644
--- a/midx.c
+++ b/midx.c
@@ -157,12 +157,10 @@ struct multi_pack_index *load_multi_pack_index(const char *object_dir, int local
cur_pack_name += strlen(cur_pack_name) + 1;
- if (i && strcmp(m->pack_names[i], m->pack_names[i - 1]) <= 0) {
- error(_("multi-pack-index pack names out of order: '%s' before '%s'"),
+ if (i && strcmp(m->pack_names[i], m->pack_names[i - 1]) <= 0)
+ die(_("multi-pack-index pack names out of order: '%s' before '%s'"),
m->pack_names[i - 1],
m->pack_names[i]);
- goto cleanup_fail;
- }
}
return m;