Jeff King [off-list ref] writes:
I'd be OK with just this, but adding a binary t/t5319/zero-objs.midx
would be fine by me, too.
Yup, that sounds like a simple way to make sure we won't regress.
One minor style nit:
quoted
@@ -1124,6 +1130,13 @@ int verify_midx_file(struct repository *r, const char *object_dir, unsigned flag
i, oid_fanout1, oid_fanout2, i + 1);
}
+ if (m->num_objects == 0) {
+ midx_report(_("the midx contains no oid"));
+ // remaining tests assume that we have objects, so we can
+ // return here
+ return verify_midx_error;
+ }
We prefer /**/ for comments, like:
/*
* Remaining tests assume that we have objects, so we can
* return here.
*/
Thanks for catching it.