Subject: Re: [RFC/PATCH] fsck: do not canonicalize modes in trees we are checking

From: Jeff King <[email-masked]>
Date: Mon, 20 Oct 2014 02:21:57 -0700

On Sun, Oct 19, 2014 at 11:40:22PM +1100, Ben Aveling wrote:

> This seems to have worked. I also had to move away the existing .idx and
> copy in a new one before it was happy.

Sorry if I wasn't clear; you do need to copy the .idx files along with
the packfiles (you can regenerate the .idx files from the packfiles on
the destination, but they're not that big; it's probably easier just to
copy them).

> I'm not sure that what I've done is so different from simply copying the
> other version of the repository - there shouldn't have been anything in the
> corrupt version that wasn't also in the good one. But any rate, it worked.

Right, a valid technique for repairing corruption is to just blow away
the original repo entirely and replace it with a good copy. But this is a
way of ensuring that no commits are missed, and keeping the original set
of refs, config options, and reflogs.

-Peff