Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] IllegalStateException in DirCacheBuilder

Thank you, I will check the code for such mistakes.


On Mon, May 23, 2011 at 10:04 PM, Robin Rosenberg <robin.rosenberg@xxxxxxxxxx> wrote:
On 2011-05-23 17.25, Shawn Pearce wrote:
> On Mon, May 23, 2011 at 00:58, Akos Tajti <akos.tajti@xxxxxxxxx> wrote:
>> I got the following exception during checkout:
>> java.lang.IllegalStateException: Duplicate stages not allowed: 0 新建 WinRAR
>> 压缩文件.rar
>> Could you please tell me what situations can cause this exception?
> Somehow there are two DirCacheEntry records in the DirCache for the
> same file path, and the same stage number. This should never occur and
> is a programming error in whatever code write the $GIT_DIR/index to
> disk like that, or created it that way in memory.
> I'm pretty sure *nobody* writes it to disk like this, and the
> exception came out of JGit after it tried to write the index out like
> this. So you would need to back track and find what code modified the
> DirCache in memory, and start looking there for the culprit. Its
> possible there is a bug somewhere in JGit's DirCache related code that
> tries to create a DirCache with this duplicate stage 0.

It is easy to accomplish this mistake if you use the DirCache, API, in
particular DirCacheEditor API, the wrong way. E.g. don't call finish AND

-- robin

Back to the top