"GOT", but the "O" is a cute, smiling pufferfish. Index | Thread | Search

From:
Stefan Sperling <stsp@stsp.name>
Subject:
Re: error out when searching a pack index which lacks a corresponding pack file
To:
"Todd C. Miller" <Todd.Miller@sudo.ws>
Cc:
gameoftrees@openbsd.org
Date:
Sun, 4 Jul 2021 20:11:22 +0200

Download raw body.

Thread
On Sun, Jul 04, 2021 at 12:08:14PM -0600, Todd C. Miller wrote:
> On Sun, 04 Jul 2021 12:40:28 +0200, Stefan Sperling wrote:
> 
> > Some Git repository clones created by Git can somehow end up with pack index
> > files that lack a corresponding pack file. This came up on the #gameoftrees
> > IRC channel recently where the repository was cloned by git clone --bare
> > from a https:// URL.
> >
> > Git seems to silently ignore this problem. I think we should be treating
> > this as a repository corruption issue because a lonely index should never
> > appear intentionally.
> > A pack file without an index is valid, but an index without a pack file can
> > never be valid. When removing a pack file the corresponding index should
> > always be removed first before the pack file gets removed.
> 
> Is there any way to recover from this other than cloning a new copy
> of the repo?

You can simply remove the orphaned .idx files with rm(1).
If that isn't obvious, perhaps the error message should suggest doing that?