-
-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Tests use user/system git config #989
Comments
The documentation for
https://libgit2.org/libgit2/#HEAD/group/repository/git_repository_config But didn't find how to set the config to a repository. This is probably a question a libgit2 developer could answer faster than me, ping @ethomson @carlosmn |
We run into the same problem - the way we handle it in libgit2 is to set the various config search paths to dummy values to avoid them reading from the global paths. libgit2: https://github.com/libgit2/libgit2/blob/master/tests/clar_libgit2.c#L565 |
This is something that we do before we ever init up a repository. I think that's probably the best approach, since opening a repository could hit those configs, I think. So if you can do it generally in the test harness, all the better. |
Thanks! |
eg:
git config --global diff.noprefix true
pytest -v test/test_diff.py
Presumably this is a symptom of the entire test run picking up the user/system git configuration, which seems bad from a reproducibility perspective? I couldn't see anything in the docs to tweak whether pygit2 picks up environment settings.
Setting
GIT_CONFIG=/dev/null
andGIT_CONFIG_NOSYSTEM=1
would sort it for cgit, but I don't think libgit2 picks up settings in the same way?The text was updated successfully, but these errors were encountered: