diff --git a/lib/src/settings.rs b/lib/src/settings.rs index 1a6bac527..71f219ac2 100644 --- a/lib/src/settings.rs +++ b/lib/src/settings.rs @@ -55,13 +55,15 @@ impl UserSettings { } pub fn user_name(&self) -> String { - self.config.get_str("user.name").expect("no user.name set") + self.config + .get_str("user.name") + .unwrap_or_else(|_| "".to_string()) } pub fn user_email(&self) -> String { self.config .get_str("user.email") - .expect("no user.email set") + .unwrap_or_else(|_| "".to_string()) } pub fn config(&self) -> &config::Config { diff --git a/src/commands.rs b/src/commands.rs index 67bc34cbc..6e25ad4ea 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -825,7 +825,11 @@ fn cmd_files( let mut repo_command = command.repo_helper(ui)?; let commit = repo_command.resolve_revision_arg(sub_matches)?; for (name, _value) in commit.tree().entries() { - writeln!(ui, "{}", &ui.format_file_path(repo_command.repo().working_copy_path(), &name))?; + writeln!( + ui, + "{}", + &ui.format_file_path(repo_command.repo().working_copy_path(), &name) + )?; } Ok(()) }