Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
cli: Properly trim `patch` message
Alexis Sellier committed 3 years ago
commit fb2c388a5de1e732d9692811e05e8a552ad4a963
parent a5ee494fda700b0d7a92e83f41ae78bda9c2c87c
1 file changed +3 -3
modified radicle-cli/src/commands/patch/create.rs
@@ -34,19 +34,19 @@ pub fn handle_patch_message(
        .message()
        .ok_or(anyhow!("commit summary is not valid UTF-8; aborting"))?;
    let message = message.get(&format!("{commit_message}{PATCH_MSG}"));
+
    let message = message.replace(PATCH_MSG.trim(), ""); // Delete help message.
    let (title, description) = message.split_once("\n\n").unwrap_or((&message, ""));
    let (title, description) = (title.trim(), description.trim());
-
    let description = description.replace(PATCH_MSG.trim(), ""); // Delete help message.

    if title.is_empty() {
        anyhow::bail!("a title must be given");
    }

    term::blank();
-
    term::patch::print_title_desc(title, &description);
+
    term::patch::print_title_desc(title, description);
    term::blank();

-
    Ok((title.to_string(), description))
+
    Ok((title.to_string(), description.to_owned()))
}

fn show_patch_commit_info(