From 5d3160831b5f04e4e7ad28ff52f324614bd76e3b Mon Sep 17 00:00:00 2001 From: Hamcha Date: Sun, 26 Nov 2023 22:57:50 +0100 Subject: [PATCH] fuck up your gitconfig for no reason --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index 4374d16..b68d590 100644 --- a/src/main.rs +++ b/src/main.rs @@ -4,6 +4,7 @@ use anyhow::{anyhow, Result}; use axum::middleware::from_fn; use bollard::Docker; use clap::Parser; +use git2::Config; use std::{net::SocketAddr, path::PathBuf}; use tokio::fs; @@ -73,6 +74,11 @@ async fn main() -> Result<()> { author_email, }; + // Fix up local git config for docker scenarios + let mut config = Config::open_default()?; + // Add "*" to safe.directory + config.set_str("safe.directory", "*")?; + // Make sure stack arg exists and is properly initialized fs::create_dir_all(&args.stack_dir).await?; let repository = ThreadSafeRepository::ensure_repository(gitconfig, &args.stack_dir)?;