Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] DirCacheTree: ArrayIndexOutOfBoundsExceptio

On Tue, Dec 21, 2010 at 11:44, Shawn Pearce <spearce@xxxxxxxxxxx> wrote:
> On Mon, Dec 20, 2010 at 23:53, Marc Strapetz <marc.strapetz@xxxxxxxxxxx> wrote:
>> Reported two times more, one of the user has a backup for which the
>> problem is reproducible.
>
> Ooh.  Reproducible with a backup is good.  Unfortunately I'm sort of
> at a loss as to how this occurs.  Any chance I can get their
> $GIT_DIR/index file?

OK, I think I understand the problem.

If the DirCache has the 'TREE' extension, and the user has staged a
change in a subdirectory into the index, that directory (and its
parents, up to the root) in the 'TREE' extension is marked invalid.
When a directory is invalid, the 'TREE' extension doesn't know how
many files live within that directory.  That count is a negative
value, typically -1.  But its used as though it were a positive value
by DirCacheIterator.

I'm not yet sure how to fix it.  When traversing over a DirCache that
contains invalid directories in the 'TREE' extension area, we'll need
to fix this entry count, or try to bypass it somehow by computing it
on the fly.  I'll keep working on it today and see if I can get a
patch posted for review.

-- 
Shawn.


Back to the top