c - How to get the diff of a single file with libgit2? -
is there function equivalent git diff file in libgit2? in other words, how efficiently retrieve diff of single file without having libgit2 @ other files in working directory?
git diff file display changes you've made relative index.
this can achieved through use of libgit2 git_diff_index_to_workdir() function.
this function accepts git_diff_options structure parameter can provide pathspec, or list of pathspecs, you're interested in.
more information this:
- documentation of function.
- unit test leveraging use case.
Comments
Post a Comment