diff options
author | Cyborus <cyborus@cyborus.xyz> | 2024-11-04 05:12:54 +0100 |
---|---|---|
committer | Cyborus <cyborus@cyborus.xyz> | 2024-11-04 05:12:54 +0100 |
commit | b201206c8bc3337480aa203568cdb599289eb9f2 (patch) | |
tree | 53998476051ebe0ddb953e444ae9c04a32d0e794 | |
parent | feat: support agit prs in pr detection (diff) | |
download | forgejo-cli-b201206c8bc3337480aa203568cdb599289eb9f2.tar.xz forgejo-cli-b201206c8bc3337480aa203568cdb599289eb9f2.zip |
feat: don't show empty base branch name
i.e. agit prs don't have a base branch, so the title is empty. looks better to not display that
-rw-r--r-- | src/prs.rs | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -528,7 +528,11 @@ pub async fn view_pr(repo: &RepoName, api: &Forgejo, id: Option<u64>) -> eyre::R println!( "By {white}{username}{reset} {dash} {state} {dash} {bright_green}+{additions} {bright_red}-{deletions}{reset}" ); - println!("From `{head_name}` into `{base_name}`"); + if head_name.is_empty() { + println!("Into `{base_name}`"); + } else { + println!("From `{head_name}` into `{base_name}`"); + } if let Some(body) = &pr.body { if !body.trim().is_empty() { |