Re: [PATCH v2] Perform cheaper connectivity check when pack is used as medium
- From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
- Date
- Mar 6, 2012, 11:20 UTC
- Message-ID
- <CACsJy8A+c6t_zHziPcQZ-Nw+fm0TmaG8VmDfnoPf-DzHHm8QVA@mail.gmail.com>
- In-Reply-To
- <7vfwdq8914.fsf@alter.siamese.dyndns.org>
On Sat, Mar 3, 2012 at 1:59 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 6 quoted lines
> But now you brought it up, I think we may also need to worry about a > corrupt pre-existing loose blob object. In general, we tend to always > favor reading objects from packs over loose objects, but I do not know > offhand what repacking would do when there are two places it can read the > same object from (it should be allowed to pick whichever is easier to > read).
Corrupt accidentally or on purpose? If some one can add a few corrupt loose objects to your repository, (s)he can also put a pack with a corrupt index (e.g. sha-1 does not point to the content that matches that sha-1) there too. If that corrupt pack is chosen for reading at "repack -ad" time, I think pack-objects would happily copy over whatever the index points to. And the new index that pack-objects generates (i.e. not through index-pack) may be also corrupt.
-- Duy