[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [jgit-dev] Clones of JGit bare repos act strange
- From: Shawn Pearce <spearce@xxxxxxxxxxx>
- Date: Wed, 8 Aug 2012 15:14:58 -0700
- Delivered-to: firstname.lastname@example.org
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.