Module git

Source
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 given git2::Repository.
open_repo
This (re-)initializes the repository located in the specified path.
parse_diff
Parses a given git2::Diff and returns a list of FileObjs.
parse_diff_from_buf
Same as parse_diff but takes a buffer of bytes instead of a git2::Diff.