-
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
cargo new
failed to detect vcs if parent of path does not exist
#10981
Comments
The code discovering existing vcs repo lives here. My own take is that we can first check the existence of However, we should always heed security issues such like this RFC dictates when searching upward the filesystem. Though personally, I don't think the fix is unsecure. |
What if it is many layers of directories? Should we keep checking upwards? |
That's exactly what I mean! |
@rustbot claim |
@weihanglo Sent a pull request for it. See #10987. |
I don't know what's going on in libgit2 here. It seems to work but turns out not? Anyway, I agree that we can solve it on libgit2 side. |
Open a discussion for it. libgit2/libgit2#6380 |
File a feature request for libgit2. libgit2/libgit2#6383 I would like to keep the #10987 open. At least its test cases are useful. |
Problem
cargo new
checks if the path of new package is inside a vcs repo. If there is one, it skips vcs initialize. However, if the parent of the package path does not exist, it failed to discover existing repo and initialize vsc redundantly.Steps
Initialize git in an empty directory:
Create package in
./hello/world
, note that./hello/
does not exist:Create package in
./hello/rust
,./hello/
is create by previouscargo new
call:Possible Solution(s)
No response
Notes
No response
Version
The text was updated successfully, but these errors were encountered: