Skip to content
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 initializes a new git repo within existing git repo when using a deep/path/to/project #11946

Closed
aryzing opened this issue Apr 8, 2023 · 2 comments
Labels
C-bug Category: bug

Comments

@aryzing
Copy link

aryzing commented Apr 8, 2023

Problem

I'm trying to understand whether cargo's behavior when creating a new project inside a git repo is working as intended. When creating a new project at the top level of an existing repo, it does not initialize a new git repo within the created project. However, when initializing a new project deep within an existing git repo, e.g., cargo new deep/path/to/project, a new git repo will be initialized despite the project being inside an already existing git repo.

Steps

# create in project at root of git repo
cd /repo
git init # creates /repo/.git
cargo new foo # no git repo created inside /repo/foo

# create project in subdir of git repo
cd /repo2
git init # creates /repo2/.git
cargo new foo/bar/baz # initializes new git repo at /repo2/foo/bar/baz/.git

Possible Solution(s)

If this behavior is intended, perhaps doc update will be enough?

Notes

No response

Version

cargo 1.68.2 (6feb7c9cf 2023-03-26)
@aryzing aryzing added the C-bug Category: bug label Apr 8, 2023
@hi-rustin
Copy link
Member

Duplicate of #10981

It is similar to this issue.

@weihanglo
Copy link
Member

Thanks for the report. As @hi-rustin mentioned this is somewhat a duplicate. Let's track the issue there :)

@weihanglo weihanglo closed this as not planned Won't fix, can't repro, duplicate, stale Apr 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: bug
Projects
None yet
Development

No branches or pull requests

3 participants