libgit2/libgit2 — pull request #940 by scunz (2012-09-18 20:48:28+00:00)
Title: RFC: Diff: Show submodule diff

diff_output.c:get_blob_content used to try to read the submodule commit
as a blob in the superproject's odb. Of course it cannot find it and
errors out with GIT_ENOTFOUND, implcitly terminating the whole diff
output.

This patch teaches it to create a text that describes the submodule
instead. The text looks like:

Subproject commit \n

which is what git.git does, too.

----
@arrbee, could you have a look at this (It works for me, but there is no test yet) and tell me,
- if it's the right way to go (i.e. right place to add it, filled out enough fields and doesn't leak)
- what should I do inside `get_workdir_content`, I currently think:
- use `git_submodule`-API to get the SHA1 of the checked out commit
- add a `int git_submodule_is_dirty()` to figure out the dirty-ness of the submodule checkout