Signed-off-by: kjuulh <contact@kjuulh.io>
This commit is contained in:
@@ -7,6 +7,7 @@ pub enum VcsClient {
|
||||
source: PathBuf,
|
||||
username: String,
|
||||
email: String,
|
||||
token: String,
|
||||
},
|
||||
}
|
||||
|
||||
@@ -19,6 +20,7 @@ impl VcsClient {
|
||||
path: &Path,
|
||||
git_username: Option<impl Into<String>>,
|
||||
git_email: Option<impl Into<String>>,
|
||||
git_token: String,
|
||||
) -> anyhow::Result<VcsClient> {
|
||||
if !path.to_path_buf().join(".git").exists() {
|
||||
anyhow::bail!("git directory not found in: {}", path.display().to_string())
|
||||
@@ -32,6 +34,7 @@ impl VcsClient {
|
||||
email: git_email
|
||||
.map(|e| e.into())
|
||||
.unwrap_or("bot@cuddle.sh".to_string()),
|
||||
token: git_token,
|
||||
})
|
||||
}
|
||||
|
||||
@@ -56,10 +59,15 @@ impl VcsClient {
|
||||
source,
|
||||
username,
|
||||
email,
|
||||
token,
|
||||
} => {
|
||||
let checkout_branch = std::process::Command::new("git")
|
||||
.current_dir(source.as_path())
|
||||
.args([
|
||||
"-c",
|
||||
&format!("http.extraHeader='Authorization: token {}'", token),
|
||||
"-c",
|
||||
&format!("http.extraHeader='Sudo: kjuulh'"),
|
||||
"-c",
|
||||
&format!("user.name={}", username),
|
||||
"-c",
|
||||
|
Reference in New Issue
Block a user