Skip to content

cargo new and VSC inconsistency #13583

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

Closed
Vrajs16 opened this issue Mar 14, 2024 · 2 comments
Closed

cargo new and VSC inconsistency #13583

Vrajs16 opened this issue Mar 14, 2024 · 2 comments
Labels
A-git Area: anything dealing with git C-bug Category: bug Command-new S-triage Status: This issue is waiting on initial triage.

Comments

@Vrajs16
Copy link

Vrajs16 commented Mar 14, 2024

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

  1. Create a new folder and then inside it, run git init.
  2. Then run cargo new test1, you will see that the .git folder does not exist inside of test1
  3. Then run cargo new parent/test2, you will see that the .git folder does exist inside of parent/test2
  4. Then run cargo new parent/test3, you will see that the .git folder does not exist inside of parent/test3

After running the commands it should look like this:
image

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]
@Vrajs16 Vrajs16 added C-bug Category: bug S-triage Status: This issue is waiting on initial triage. labels Mar 14, 2024
@epage epage added A-git Area: anything dealing with git Command-new labels Mar 14, 2024
@weihanglo
Copy link
Member

Thanks for the reproducible steps. This looks pretty similar to and maybe the same as #10981.

@weihanglo
Copy link
Member

Close in favor of #10981.

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Mar 15, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-git Area: anything dealing with git C-bug Category: bug Command-new S-triage Status: This issue is waiting on initial triage.
Projects
None yet
Development

No branches or pull requests

3 participants