# Module cargo::sources::git::utils

source ·
Expand description

Utilities for handling git repositories, mainly around authentication/cloning.

## Structs

- GitCheckout
  `GitCheckout` is a local checkout of a particular revision. Calling `clone_into` with a reference will resolve the reference into a revision, and return an `anyhow::Error` if no revision for that reference was found.
- GitDatabase
  `GitDatabase` is a local clone of a remote repository’s database. Multiple `GitCheckouts` can be cloned from this `GitDatabase`.
- GitRemote
  `GitRemote` represents a remote repository. It gets cloned into a local `GitDatabase`.
- GitShortID
- __SerializeWith 🔒
- __SerializeWith 🔒

## Enums

- FastPathRev 🔒

## Functions

- clean_repo_temp_files 🔒
  Removes temporary files left from previous activity.
- fetch
- fetch_with_cli 🔒
- github_fast_path 🔒
  Updating the index is done pretty regularly so we want it to be as fast as possible. For registries hosted on GitHub (like the crates.io index) there’s a fast path available to use 1 to tell us that there’s no updates to be made.
- init 🔒
- is_github 🔒
- is_short_hash_of 🔒
- looks_like_commit_hash 🔒
- maybe_gc_repo 🔒
  Cargo has a bunch of long-lived git repositories in its global cache and some, like the index, are updated very frequently. Right now each update creates a new “pack file” inside the git database, and over time this can cause bad performance and bad current behavior in libgit2.
- reinitialize 🔒
- reset 🔒
- serialize_str 🔒
- update_submodule 🔒
- update_submodules 🔒
- with_authentication 🔒
  Prepare the authentication callbacks for cloning a git repository.
- with_fetch_options