Module git

Source
Expand description

Tools for interfacing with the Git repository.

Structs§

Branch
Represents a Git branch.
CherryPickFastOptions
Options for Repo::cherry_pick_fast.
Commit
Represents a commit object in the Git object database.
Config
Wrapper around the config values stored on disk for Git.
ConfigValue
A wrapper around a possible value that can be set for a config key.
Diff
A diff between two trees/commits.
GitRunInfo
Path to the git executable on disk to be executed.
GitRunOpts
Options for invoking Git.
GitRunResult
The result of invoking Git.
GitVersion
The parsed version of Git.
Index
The Git index.
IndexEntry
An entry in the Git index.
NonZeroOid
Represents the ID of a Git object.
PatchId
A checksum of the diff induced by a given commit, used for duplicate commit detection.
Reference
Represents a reference to an object.
ReferenceName
The name of a reference, like refs/heads/master.
Repo
Wrapper around git2::Repository.
ResolvedReferenceInfo
A snapshot of information about a certain reference. Updates to the reference after this value is obtained are not reflected.
SerializedNonZeroOid
A version of NonZeroOid that can be serialized and deserialized.
SerializedTestResult
StatusEntry
The status of a file in the repo.
Time
A timestamp as used in a git2::Signature.
Tree
A tree object. Contains a mapping from name to OID.
WorkingCopySnapshot
A special Commit which represents the status of the working copy at a given point in time. This means that it can include changes in any stage.

Enums§

AmendFastOptions
Options for Repo::amend_fast
CategorizedReferenceName
Determine what kind of branch a reference is, given its name.
CreateCommitFastError
An error raised when attempting to create create a commit via Repo::cherry_pick_fast.
FileMode
Wrapper around git2::FileMode.
FileStatus
A Git file status indicator. See https://git-scm.com/docs/git-status#_short_format.
GitErrorCode
An enumeration of possible errors that can happen when working with a git repository.
MaybeZeroOid
OID which may be zero or non-zero.
ReferenceTarget
The target of a reference.
RepoError
Stage
The possible stages for items in the index.
TestCommand
A test command to run.
UpdateIndexCommand
The command to update the index, as defined by git update-index.
WorkingCopyChangesType
The type of changes in the working copy, if any.

Constants§

TEST_ABORT_EXIT_CODE
The exit status used to abort a process.
TEST_INDETERMINATE_EXIT_CODE
The exit status to use when a test command intends to skip the provided commit.
TEST_SUCCESS_EXIT_CODE
The exit status to use when a test command succeeds.

Traits§

ConfigRead
Read-only interface to Git’s configuration.
ConfigWrite
Write-only interface to Git’s configuration.

Functions§

dehydrate_tree
Filter the entries in the provided tree by only keeping the provided paths.
get_changed_paths_between_trees
Get the paths which are different between two tree objects. This is faster than the git2 implementation, which always iterates all tree entries in all tree objects recursively.
get_latest_test_command_path
Get the path to the file where the latest test command is stored.
get_test_locks_dir
Get the directory where the locks for running tests are stored.
get_test_tree_dir
Get the directory where the result of tests for a particular commit are stored.
get_test_worktrees_dir
Get the directory where the worktrees for running tests are stored.
hydrate_tree
Add the provided entries into the tree.
make_test_command_slug
Convert a command string into a string that’s safe to use as a filename.
message_prettify
Clean up a message, removing extraneous whitespace plus comment lines starting with comment_char, and ensure that the message ends with a newline.
process_diff_for_record
Calculate the diff between the index and the working copy.
update_index
Update the index. This handles updates to stages other than 0.

Type Aliases§

BranchType
Re-export of git2::BranchType. This might change to be an opaque type later.
RepoResult
Result type.