diff options
author | Jeff King <peff@peff.net> | 2018-05-14 12:22:48 -0400 |
---|---|---|
committer | Jeff King <peff@peff.net> | 2018-05-21 23:55:12 -0400 |
commit | 2738744426c161a98c2ec494d41241a4c5eef9ef (patch) | |
tree | 06aee7bffd5588f7f8662a7f05de87b833cc00c7 /compat/bswap.h | |
parent | fsck: detect gitmodules files (diff) | |
download | tgif-2738744426c161a98c2ec494d41241a4c5eef9ef.tar.xz |
fsck: handle promisor objects in .gitmodules check
If we have a tree that points to a .gitmodules blob but
don't have that blob, we can't check its contents. This
produces an fsck error when we encounter it.
But in the case of a promisor object, this absence is
expected, and we must not complain. Note that this can
technically circumvent our transfer.fsckObjects check.
Imagine a client fetches a tree, but not the matching
.gitmodules blob. An fsck of the incoming objects will show
that we don't have enough information. Later, we do fetch
the actual blob. But we have no idea that it's a .gitmodules
file.
The only ways to get around this would be to re-scan all of
the existing trees whenever new ones enter (which is
expensive), or to somehow persist the gitmodules_found set
between fsck runs (which is complicated).
In practice, it's probably OK to ignore the problem. Any
repository which has all of the objects (including the one
serving the promisor packs) can perform the checks. Since
promisor packs are inherently about a hierarchical topology
in which clients rely on upstream repositories, those
upstream repositories can protect all of their downstream
clients from broken objects.
Signed-off-by: Jeff King <peff@peff.net>
Diffstat (limited to 'compat/bswap.h')
0 files changed, 0 insertions, 0 deletions