feat: with git username and email in config

Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
2023-08-01 22:38:58 +02:00
parent 1e15e41354
commit 5229d30758
7 changed files with 81 additions and 11 deletions

View File

@@ -89,7 +89,7 @@ impl Command {
pub fn execute(self, current_dir: Option<&Path>) -> anyhow::Result<()> {
let config = self.build_config(current_dir)?;
let git_client = self.get_git(config.get_source())?;
let git_client = self.get_git(&config)?;
let gitea_client = self.get_gitea_client(&config);
match &self.commands {
@@ -131,11 +131,15 @@ impl Command {
Ok(config)
}
fn get_git(&self, current_dir: &Path) -> anyhow::Result<VcsClient> {
fn get_git(&self, config: &PleaseConfig) -> anyhow::Result<VcsClient> {
if self.global.no_vcs {
Ok(VcsClient::new_noop())
} else {
VcsClient::new_git(current_dir)
VcsClient::new_git(
config.get_source(),
config.settings.git_username.clone(),
config.settings.git_email.clone(),
)
}
}