summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorCyborus <cyborus@cyborus.xyz>2024-11-04 05:12:54 +0100
committerCyborus <cyborus@cyborus.xyz>2024-11-04 05:12:54 +0100
commitb201206c8bc3337480aa203568cdb599289eb9f2 (patch)
tree53998476051ebe0ddb953e444ae9c04a32d0e794
parentfeat: support agit prs in pr detection (diff)
downloadforgejo-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.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/prs.rs b/src/prs.rs
index 38e31ff..af7857f 100644
--- a/src/prs.rs
+++ b/src/prs.rs
@@ -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() {