This issue is related to libgit2sharp; however, I think it is located in libgit2.
If you have a submodule in a subdirectory, e.g. "modules\themodule" and use Windows, git_status_foreach returns the path with a backslash.
If you then want to stage the change, you (at least libgit2sharp does it that way) lookup the submodule (git_submodule_lookup) path and stage it (git_submodule_add_to_index).
Now the problem is that git_submodule_lookup returns null because the path contains a backslash instead of a slash.
I see three possibilities:
- Change
git_status_foreach so that it returns submodule changes with slashes (makes it inconsistent with file changes)
- Change
git_submodule_lookup, so that it replaces backslashes with slashes
- Replace backslashes with slashes on your own (e.g. in libgit2sharp)
The first one is rubbish. I think we should go with the second possibility because it is not intrusive and makes the function more robust.
If you don't aggree on this, I hand over this issue to libgit2sharp.
This issue is related to libgit2sharp; however, I think it is located in libgit2.
If you have a submodule in a subdirectory, e.g. "modules\themodule" and use Windows,
git_status_foreachreturns the path with a backslash.If you then want to stage the change, you (at least libgit2sharp does it that way) lookup the submodule (
git_submodule_lookup) path and stage it (git_submodule_add_to_index).Now the problem is that
git_submodule_lookupreturnsnullbecause the path contains a backslash instead of a slash.I see three possibilities:
git_status_foreachso that it returns submodule changes with slashes (makes it inconsistent with file changes)git_submodule_lookup, so that it replaces backslashes with slashesThe first one is rubbish. I think we should go with the second possibility because it is not intrusive and makes the function more robust.
If you don't aggree on this, I hand over this issue to libgit2sharp.