Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] add -u removes sub-module directories

This is a known issue that I was able to easily reproduce.

The AddCommand will currently stage for deletion any submodules that are present in the index but not reported as being in the working directory.

I have pushed a proposed fix: https://git.eclipse.org/r/#/c/5313/

It retains submodule in the index that are not present in the working directory which mirrors the behavior of CGit.

Sincerely,
Kevin

On Thu, Mar 8, 2012 at 11:09 PM, Thomas Hallgren <thomas@xxxxxxx> wrote:
I clone a repository from GitHub that contains a submodule.

 https://github.com/devstructure/blueprint

The submodule 'mustache.sh' is represented as an empty directory in the working directory of the clone. So far so good. Now I do the following:

 Git git = new Git(repository);
 git.add().addFilePattern(".").setUpdate(true).call();

I don't expect any changes, but for some reason there is one. I can see it using the command line git:

$ git status
# On branch master
# Changes to be committed:
#   (use "git reset HEAD <file>..." to unstage)
#
#    deleted:    mustache.sh
#

This isn't correct, and it doesn't happen when I do the same operation using the command line git:

$ git reset --hard
$ git add -u .
$ git status
# On branch master
nothing to commit (working directory clean)

So a jgit correspondence to "git add -u ." is different in that it removes the directory that tracks the submodule. Is this a known issue with jgit?

I'm currently using jgit 1.3.0.201202151440-r

Regards,
Thomas Hallgren

_______________________________________________
jgit-dev mailing list
jgit-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/jgit-dev


Back to the top