Radish alpha
r
rad:zwTxygwuz5LDGBq255RA2CbNGrz8
Radicle CI broker
Radicle
Git
fix: allow Whence::Patch revision to be optional
Merged liw opened 2 years ago

Signed-off-by: Lars Wirzenius liw@liw.fi

2 files changed +9 -3 10bdac07 f9196a2c
modified src/pages.rs
@@ -245,7 +245,13 @@ impl PageData {
                .with_child(
                    Element::new(Tag::Code)
                        .with_attribute("class", "revision")
-
                        .with_text(&revision.to_string()),
+
                        .with_text(&{
+
                            if let Some(rev) = &revision {
+
                                rev.to_string()
+
                            } else {
+
                                "<unknown patch revision>".to_string()
+
                            }
+
                        }),
                )
                .with_child(Element::new(Tag::Br))
                .with_text("commit ")
modified src/run.rs
@@ -119,7 +119,7 @@ pub enum Whence {
    Patch {
        patch: Oid,
        commit: Oid,
-
        revision: Revision,
+
        revision: Option<Revision>,
        who: Option<String>,
    },
}
@@ -137,7 +137,7 @@ impl Whence {
        Self::Patch {
            patch,
            commit,
-
            revision,
+
            revision: Some(revision),
            who: who.map(|s| s.to_string()),
        }
    }