Skip to main content

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

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



Back to the top