diff options
Diffstat (limited to 'include/git2/diff.h')
-rw-r--r-- | include/git2/diff.h | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/include/git2/diff.h b/include/git2/diff.h index a0cfbc918..450fc3c79 100644 --- a/include/git2/diff.h +++ b/include/git2/diff.h @@ -775,6 +775,25 @@ GIT_EXTERN(int) git_diff_tree_to_workdir_with_index( const git_diff_options *opts); /**< can be NULL for defaults */ /** + * Create a diff of the changes between a commit and its parent(s). + * + * This generates a diff list between a commit and its parents. For a + * non-merge commit, this is simply a shortcut for `git_diff_tree_to_tree` + * between the commit tree and the parent tree. For a parent-less commit, + * this will generate a diff with the content of the commit tree. For a + * merge commit, this generates a diff that contains only files that do + * not match any of the parents' trees. + * + * @param diff A pointer to a git_diff pointer that will be allocated. + * @param commit A git_commit object to diff from + * @param opts Structure with options to influence diff or NULL for defaults. + */ +GIT_EXTERN(int) git_diff_commit( + git_diff **diff, + git_commit *commit, + const git_diff_options *opts); /**< can be NULL for defaults */ + +/** * Merge one diff into another. * * This merges items from the "from" list into the "onto" list. The |