check_repo_state in cargo::ops::cargo_package::vcs - Rust
Description: Checks if the package source is in a git DVCS repository.

Skip to main content

## check_repo_state

# Function check_repo_state

Source

    pub fn check_repo_state(
        p: &Package,
        src_files: &[PathEntry],
        ws: &Workspace<'_>,
        opts: &PackageOpts<'_>,
    ) -> CargoResult<Option<VcsInfo>>

Expand description

Checks if the package source is in a git DVCS repository.

If git, and the source is dirty (e.g., has uncommitted changes), and `--allow-dirty` has not been passed, then `bail!` with an informative message. Otherwise, return the sha1 hash of the current HEAD commit, or `None` if no repo is found.