Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] question on pack files

On Thu, Jan 13, 2011 at 06:34, Dmitry Neverov <dmitry.neverov@xxxxxxxxx> wrote:
> is it possible that .pack file was saved in objects/pack/ dir but
> jgit is stay unaware that it has objects from this pack and tries to
> download pack again?

This shouldn't occur unless the .idx file is missing.  JGit needs the
.idx to use the .pack, and will skip a .pack that doesn't have a
sibling .idx file.

> I read the code of IndexPack.renameAndOpenPack() and it delete
> final .idx and .pack files only in the case of IOException. What
> if other error occurs during the call to repo.openPack(finalPack, finalIdx)?

If another error occurs here its likely a mismatch between the
finalPack and finalIdx; e.g. their object counts disagree or the
trailing SHA-1 checksum doesn't match.  This case is very unlikely for
IndexPack as it just created the two files.  The other failure might
be you cannot open the files because the JVM process is out of file
descriptors.  Again there isn't much we can do here, and it doesn't
imply the files are invalid, so we shouldn't delete them.

What are you seeing occur?  I can't come up with a way for JGit to
fail to identify a pack that went through Repository.openPack() as
called by IndexPack.

-- 
Shawn.


Back to the top