-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
Start searching git config at new path #8886
Start searching git config at new path #8886
Conversation
Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @alexcrichton (or someone else) soon. If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes. Please see the contribution instructions for more information. |
b8f32cd
to
d44d280
Compare
I am not entirely sure what causes the failed test on Windows (I have no way of reproducing it locally):
The way how the new test crafts paths matches what surrounding tests use (e.g. |
The test failed again ... with the same error. I assume the culprit is the forward slash in BTW: I am not force pushing the attempts to fix the problem to make it easier to review. Before merging I'd like to squash the (supposed) fixes into the first commit. |
This is progress: A new error.
From if (line[rpos] != '"' || line[rpos + 1] != ']') {
set_parse_error(reader, rpos, "unexpected text after closing quotes");
git_buf_dispose(&buf);
return -1;
} It's hard for me to see why this would not be the case in this test because I lack access to a Windows environment. Does anyone with more experience have a lead? @alexcrichton |
I use |
Thanks, @DJMcNab, I'll give it a try. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me and seems like the right fix, thanks!
Yeah, I've just debugged it to the same thing @alexcrichton found. I got it working by adding .to_string()
.replace('\\', "/"), to both paths |
Thanks a lot for helping out with debugging. So in fact it is still the same problem that I had supposedly fixed earlier. I was under the assumption that How do I go about this now? Just including |
I don't think it would matter on other platforms, since they wouldn't have |
I am not super happy with the hack but I can live with it. I'll squash the commits and rebase on master. Then this PR is ready to be merged from my side. |
This lets `cargo new` follow `includeIf` blocks inside .gitignore. Fixes rust-lang#8882
e7d11b1
to
35b029c
Compare
@bors: r+ Sounds reasonable to me! |
📌 Commit 35b029c has been approved by |
☀️ Test successful - checks-actions |
Update cargo 10 commits in 2af662e22177a839763ac8fb70d245a680b15214..bfca1cd22bf514d5f2b6c1089b0ded0ba7dfaa6e 2020-11-12 19:04:56 +0000 to 2020-11-24 16:33:21 +0000 - Shrink the progress bar, to give more space after it. (rust-lang/cargo#8892) - Add some comments to the toml code (rust-lang/cargo#8887) - Start searching git config at new path (rust-lang/cargo#8886) - Fix documentation for CARGO_PRIMARY_PACKAGE. (rust-lang/cargo#8891) - Bump to 0.51.0, update changelog (rust-lang/cargo#8894) - Publish target's "doc" setting when emitting metadata (rust-lang/cargo#8869) - Relaxes expectation of `cargo test` tests to accept test execution time (rust-lang/cargo#8884) - Finish implementation of `-Zextra-link-arg`. (rust-lang/cargo#8441) - Reproducible crate builds (rust-lang/cargo#8864) - Allow resolver="1" to explicitly use the old resolver behavior. (rust-lang/cargo#8857)
Fix test escaping __CARGO_TEST_ROOT #8886 added a test which unsets `__CARGO_TEST_ROOT`, but that environment variable is there for a reason. This causes problems as it causes that test to load the `.cargo/config` from the real home directory, which if it contains a `[cargo-new]` section, causes the test to fail. The fix here is to change `find_tests_git_config` so that it behaves more like the real git config loader, but avoids escaping the test sandbox. There are some subtle issues here, like #7469, which I believe should still work correctly.
This lets
cargo new
followincludeIf
blocks inside .gitignore.Fixes #8882
I am not sure if removing the
__CARGO_TEST_ROOT
environment variable has any bad side effects. My quick grep of the repository didn't highlight anything in particular.