Skip to main content

declared

Function declared 

Source
pub fn declared(value: &str) -> Result<MeshRepositoryIdentity, MeshError>
Expand description

The identity a declared value yields: what a shallow clone, which cannot see its own root commit, must use, and what separates a fork that should not cooperate with the repository it came from. The value is a name chosen by the people who run the mesh, not a digest, so it is bounded and must not be empty — an empty declaration would put every repository that forgot to fill it in on one mesh.

use majordomus_cli::mesh::repository::declared;

let a = declared("majordomus").unwrap();
assert_eq!(a.id, declared("  majordomus  ").unwrap().id, "surrounding space is noise");
assert_ne!(a.id, declared("majordomus-fork").unwrap().id);
assert!(declared("").is_err(), "an empty declaration would merge unrelated repositories");