fn create_config(path: PathBuf, identity: &IdentityConfig) -> Result<(), anyhow::Error> {
let global_config = config::Global {
author: config::Author {
key_path: None,
name: identity.identity_name.clone(),
email: identity.email.clone(),
full_name: Some(identity.full_name.clone()),
},
unrecord_changes: None,
colors: None,
pager: None,
template: None,
ignore_kinds: None,
};
let mut config_file = std::fs::File::create(path)?;
config_file.write_all(toml::to_string(&global_config)?.as_bytes())?;
Ok(())
}