Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
o2sh committed Jan 25, 2025
1 parent 5440941 commit af7e84c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/info/url.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,11 @@ pub fn get_repo_url(repo: &Repository, hide_token: bool, http_url: bool) -> Resu
None => return Ok(String::new()),
};

if let Some(url) = remote.url(gix::remote::Direction::Push) {
Ok(format_url(&url.to_string(), hide_token, http_url))
} else {
Ok(String::new())
}
Ok(remote
.url(gix::remote::Direction::Push)
.map(|url| format_url(&url.to_string(), hide_token, http_url))
.unwrap_or_default())

}

fn format_url(url: &str, hide_token: bool, http_url: bool) -> String {
Expand Down

0 comments on commit af7e84c

Please sign in to comment.