Parse author string into name and email.
(&self)
| 434 | |
| 435 | /// Parse author string into name and email. |
| 436 | fn parse_author(&self) -> Option<(String, Option<String>)> { |
| 437 | self.author.as_ref().map(|author_str| { |
| 438 | // Try to parse "Name <email>" format |
| 439 | if let Some(start) = author_str.find('<') { |
| 440 | if let Some(end) = author_str.find('>') { |
| 441 | let name = author_str[..start].trim().to_string(); |
| 442 | let email = author_str[start + 1..end].trim().to_string(); |
| 443 | return (name, Some(email)); |
| 444 | } |
| 445 | } |
| 446 | // Just a name |
| 447 | (author_str.trim().to_string(), None) |
| 448 | }) |
| 449 | } |
| 450 | |
| 451 | /// Display what would be done in dry-run mode. |
| 452 | fn display_dry_run( |