Skip to main content

git_identity

Function git_identity 

Source
pub fn git_identity(root: &Path) -> Option<GitIdentity>
Expand description

Ask git which repository the checkout at root belongs to. One subprocess; None when git is absent or the root is not a work tree.

use majordomus_cli::repository::git_identity;
let plain = tempfile::tempdir().unwrap();
assert!(git_identity(plain.path()).is_none(), "a plain directory belongs to no repository");