1

I'm having difficulties making libgit2sharp / libgit2 work with git submodules.

I have git repository with several items linked as submodules to folder within repository. Git and GitHub recognizes them fine, however when I'm trying to retrieve these folders status via libgit2sharp / libgit2 an exception raises. It says that "Failed to determine status of file '[filename]'. Provided path leads to a folder, not a file"

Should libgit2 provide status for submodule folders? Do they have status at all? At the moment I'm just skipping querying of these items state, but feel it isn't right.

Many thanks in advance for your help!

nulltoken
  • 64,429
  • 20
  • 138
  • 130
shytikov
  • 9,155
  • 8
  • 56
  • 103

2 Answers2

3

I found the offending piece of code :)

Beware both libgit2 and libgit2sharp are works in progress. They're not git feature complete. And, as far as I know, submodules are not implemented yet.

Should libgit2 provide status for submodule folders? Do they have status at all? At the moment I'm just skipping querying of these items state, but feel it isn't right.

I can think of two places where those questions would be answered:

nulltoken
  • 64,429
  • 20
  • 138
  • 130
2

If you want to get the update information of submodules, you need to enter the submodule folder and treat it as a total repo. The root repo only track the commit id of submodules.
Maybe you'll be interested in this Question.
Wish it is what you want. :)
And here is a doc on submodule.

Community
  • 1
  • 1
Kjuly
  • 34,476
  • 22
  • 104
  • 118