Skip to main content

repo_identity

Function repo_identity 

Source
pub fn repo_identity(repo_path: &Path) -> Option<String>
Expand description

A repository’s root commit — the one identifier that survives being moved.

The registry is keyed by path, so a workspace that is moved or renamed looks like a repository that vanished and a different one that appeared: the prune history is stranded on a path that will never exist again, and the same project registers a second time from scratch. The root commit is identical on both sides of that move, which is what lets link and init join them back up.

None when the repository has no commits yet, or when git refuses to answer. There is nothing to identify an empty repository by, and a guess would be worse than the dead entry it replaced.