Fix: set default git config search path for tests#9035
Fix: set default git config search path for tests#9035bors merged 3 commits intorust-lang:masterfrom
Conversation
|
(rust-highfive has picked a reviewer for you, use r? to override) |
13fcd2e to
b8e9a20
Compare
|
Thanks for the PR! I don't think this is the correct solution, however, because each thread has its own unique search path, right? The libgit2 search path is a global configuration option so if all threads are always changing it then I don't think that it is guaranteed to be configured correctly for each test? |
My fault. I didn't notice that 😅. The original goal is to prevent global configurations from affecting tests. What if we set the search path to nowhere (maybe a empty directory?) and let git configs keep the defaults? |
|
That seems reasonable to me, yeah, having a sort of one-time configuration which points it to a blank location. |
b8e9a20 to
e5854a4
Compare
crates/cargo-test-support/src/git.rs
Outdated
There was a problem hiding this comment.
FWIW instead of using lazy_static this can use a sync::sync::Once
There was a problem hiding this comment.
Fixed. Thanks!
This pull request is almost ready for review. Is there any plan to rollout a new release of git2?
There was a problem hiding this comment.
Sure yeah, I just published a new version.
4a47774 to
86be6d4
Compare
35e2277 to
332887e
Compare
|
Since git2-rs#0.13.16 is released. This pull request is now ready for review. |
|
Thanks! Could this bump the version requirement on |
|
@bors: r+ |
|
📌 Commit 06d65a4 has been approved by |
|
☀️ Test successful - checks-actions |
Update cargo 7 commits in 783bc43c660bf39c1e562c8c429b32078ad3099b..c3abcfe8a75901c7c701557a728941e8fb19399e 2021-01-20 19:02:26 +0000 to 2021-01-25 16:16:43 +0000 - Minor update to tracking issue template. (rust-lang/cargo#9097) - Add some extra help to `cargo new` and invalid package names. (rust-lang/cargo#9098) - Fix compilation with serde 1.0.122 (rust-lang/cargo#9102) - Add suggestion for bad package id. (rust-lang/cargo#9095) - Remove Registry::new. (rust-lang/cargo#9093) - Fix: set default git config search path for tests (rust-lang/cargo#9035) - Unstable updates (rust-lang/cargo#9092)
Fixes #8863 by setting the default config search path.
Just wait rust-lang/git2-rs#656 being merged and update Cargo.toml the new release of git2-rs 😄