Parse author string into name and email.
(&self)
| 443 | |
| 444 | /// Parse author string into name and email. |
| 445 | pub(crate) fn parse_author(&self) -> Option<(String, Option<String>)> { |
| 446 | self.author.as_ref().map(|author_str| { |
| 447 | // Try to parse "Name <email>" format |
| 448 | if let Some(start) = author_str.find('<') { |
| 449 | if let Some(end) = author_str.find('>') { |
| 450 | let name = author_str[..start].trim().to_string(); |
| 451 | let email = author_str[start + 1..end].trim().to_string(); |
| 452 | return (name, Some(email)); |
| 453 | } |
| 454 | } |
| 455 | // Just a name |
| 456 | (author_str.trim().to_string(), None) |
| 457 | }) |
| 458 | } |
| 459 | |
| 460 | /// Display what would be done in dry-run mode. |
| 461 | fn display_dry_run( |