In both cases, the file contents change from 'X contents\n' to 'X
contents 2\n' (where 'X' is 'a' or 'b'). This means were removing one
line and adding another.
I'm not sure how this test was passing against libgit2 v0.17.0, so I
may be missing something important.
Added missing support for a diff against workdir or an index.
The latter one differs from `git diff HEAD` because git itself
does a merge of workdir and index (see docs of git_diff_workdir_to_tree).