Expand description
This module is primarily used to parse diff blobs.
It can also be used (locally) to get a list of files changes from either the last commit or the next commit’s staging area.
This also includes a private module that is used as a fallback (brute force) mechanism when parsing diffs fail using libgit2. NOTE: parsing a diff from a buffer (str or bytes) only happens in CI or when libgit2 cannot be used to initialize a repository.
Functions§
- get_
diff - Fetch the
git2::Diff
about a givengit2::Repository
. - open_
repo - This (re-)initializes the repository located in the specified
path
. - parse_
diff - Parses a given
git2::Diff
and returns a list ofFileObj
s. - parse_
diff_ from_ buf - Same as
parse_diff
but takes a buffer of bytes instead of agit2::Diff
.