The diff object that contains all individual file deltas.
A diff
represents the cumulative list of differences between two
snapshots of a repository (possibly filtered by a set of file name
patterns).
Calculating diffs is generally done in two phases: building a list of diffs then traversing it. This makes is easier to share logic across the various types of diffs (tree vs tree, workdir vs index, etc.), and also allows you to insert optional diff post-processing phases, such as rename detection, in between the steps. When you are done with a diff object, it must be freed.
This is an opaque structure which will be allocated by one of the diff
generator functions below (such as git_diff_tree_to_tree
). You are
responsible for releasing the object memory when done, using the
git_diff_free()
function.