fix: polluting gitconfig in integrated test (#20)

* fix: polluting gitconfig in integrated test

* debug(CI): add eprintln

* debug(CI): git config

* debug(CI): git init test

* fix(CI): command construction

* debug(CI): change workdir & add same config setup

* debug(CI): use libgit2

* debug(CI): return err at the end of test using libgit2

* debug(CI): change current_dir in git config

* fix(git): git config now gets local config

CI was failing since xdbm init didn't get local git config.

* debug: add trace log

* debug: increase log level in CI

* fix: getting gitconfig now respects local config

* debug(CI): clean up debugging codes

* fix(CI): add setup_gitconfig to two_devices test

* debug(CI): inspect git config

* fix(CI): add env var to allow setting git global config

* refactor(CI): remove unnecessary arg for setup_gitconfig

* update changelog
This commit is contained in:
qwjyh 2025-02-09 08:39:57 +09:00 committed by GitHub
parent 90cebed15f
commit 47b3a5e69d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 56 additions and 12 deletions

View file

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