Closed as not planned
Description
Problem
In a intialized git repo, running cargo new parent/project
creates a new git repository inside project
if the parent folder is not already created. If the parent folder is already there then it doesn't create the git repository.
Steps
- Create a new folder and then inside it, run
git init
. - Then run
cargo new test1
, you will see that the .git folder does not exist inside oftest1
- Then run
cargo new parent/test2
, you will see that the .git folder does exist inside ofparent/test2
- Then run
cargo new parent/test3
, you will see that the .git folder does not exist inside ofparent/test3
After running the commands it should look like this:
Running step 2 should not create a .git folder but it does because the parent folder has not been created.
This also does the same thing if more than one parent
Possible Solution(s)
I am assuming that if the parent folder is not created, cargo intializes a repo, so the solution would be to not do that so that it is consistent with cargo new without a path
Notes
No response
Version
cargo 1.78.0-nightly (8964c8ccf 2024-02-27)
release: 1.78.0-nightly
commit-hash: 8964c8ccff6e420e2a38b8696d178d69fab84d9d
commit-date: 2024-02-27
host: aarch64-apple-darwin
libgit2: 1.7.2 (sys:0.18.2 vendored)
libcurl: 8.1.2 (sys:0.4.71+curl-8.6.0 system ssl:(SecureTransport) LibreSSL/3.3.6)
ssl: OpenSSL 3.2.1 30 Jan 2024
os: Mac OS 14.1.1 [64-bit]