[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Clones of JGit bare repos act strange

On Wed, Aug 8, 2012 at 1:21 PM, Roger Kapsi <rkapsi@xxxxxxxxx> wrote:
> I'm using JGit to create and initialize bare repositories and noticed
> that clones thereof (using vanilla git) act a little bit strange.
> Doing something like "git reset --hard" will toggle repeatedly between
> all files getting staged for deletion and the default (expected)
> "nothing to commit (working directory clean)" state.
>
> Here is a short standalone example: https://gist.github.com/3298119
>
> Am I missing something?

You can't put / in a Tree entry. C Git is probably very angry about this:

   formatter.append("hello/world", FileMode.REGULAR_FILE, fileId);

You need to make a tree that contains "world", format that as a tree
object, then point "hello" to that tree.