Module cargo::sources::git::utils

source ยท
Expand description

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

Structsยง

Enumsยง

Constantsยง

Functionsยง

  • Constructs an absolute URL for a child submodule URL with its parent base URL.
  • Removes temporary files left from previous activity.
  • Attempts to fetch the given git reference for a Git repository.
  • fetch_with_cli ๐Ÿ”’
    Attempts to use git CLI installed on the system to fetch a repository, when the config value net.git-fetch-with-cli is set.
  • github_fast_path ๐Ÿ”’
    Attempts GitHubโ€™s special fast path for testing if weโ€™ve already got an up-to-date copy of the repository.
  • gitoxide uses shallow locks to assure consistency when fetching to and to avoid races, and to write files atomically. Cargo has its own lock files and doesnโ€™t need that mechanism for race protection, so a stray lock means a signal interrupted a previous shallow fetch and doesnโ€™t mean a race is happening.
  • init ๐Ÿ”’
    Initializes a Git repository at path.
  • is_github ๐Ÿ”’
    Whether a url is one from GitHub.
  • is_short_hash_of ๐Ÿ”’
    Whether rev is a shorter hash of oid.
  • Whether a rev looks like a commit hash (ASCII hex digits).
  • maybe_gc_repo ๐Ÿ”’
    Attempts to git gc a repository.
  • reinitialize ๐Ÿ”’
    Reinitializes a given Git repository. This is useful when a Git repository seems corrupted and we want to start over.
  • reset ๐Ÿ”’
    git reset --hard to the given obj for the repo.
  • Resolves GitReference to an object ID with objects the repo currently has.
  • rev_to_oid ๐Ÿ”’
    Turns a full commit hash revision into an oid.
  • serialize_str ๐Ÿ”’
  • Prepare the authentication callbacks for cloning a git repository.
  • Prepares the callbacks for fetching a git repository.