fix(git): git config now gets local config

CI was failing since xdbm init didn't get local git config.
This commit is contained in:
qwjyh 2025-02-04 05:19:33 +09:00
parent 9285f44975
commit 0fcb2475b4

View file

@ -156,7 +156,11 @@ fn add_and_commit(repo: &Repository, path: &Path, message: &str) -> Result<Oid,
index.write()?; index.write()?;
let oid = index.write_tree()?; let oid = index.write_tree()?;
let tree = repo.find_tree(oid)?; let tree = repo.find_tree(oid)?;
let config = git2::Config::open_default()?; let config = {
let mut config = git2::Config::open_default()?;
config.add_file(&path.join(".git/config"), git2::ConfigLevel::Local, false)?;
config
};
let signature = git2::Signature::now( let signature = git2::Signature::now(
config.get_entry("user.name")?.value().unwrap(), config.get_entry("user.name")?.value().unwrap(),
config.get_entry("user.email")?.value().unwrap(), config.get_entry("user.email")?.value().unwrap(),