Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
Improve error message for identity error
Alexis Sellier committed 3 years ago
commit 99bd62d27610a778faf790688ff7c0866e06273c
parent 0726c553dac48490d44f67716dd398e093b68d3c
1 file changed +3 -3
modified radicle/src/storage/git.rs
@@ -63,8 +63,8 @@ impl<'a> TryFrom<git2::Reference<'a>> for Ref {
pub enum ProjectError {
    #[error("identity branches diverge from each other")]
    BranchesDiverge,
-
    #[error("identity branches are in an invalid state")]
-
    InvalidState,
+
    #[error("identity branches missing")]
+
    MissingHeads,
    #[error("storage error: {0}")]
    Storage(#[from] Error),
    #[error("identity document error: {0}")]
@@ -304,7 +304,7 @@ impl Repository {
            heads.push(oid.into());
        }
        // Keep track of the longest identity branch.
-
        let mut longest = heads.pop().ok_or(ProjectError::InvalidState)?;
+
        let mut longest = heads.pop().ok_or(ProjectError::MissingHeads)?;

        for head in &heads {
            let base = self.raw().merge_base(*head, longest)?;