-
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 init - check .gitignore before appending /target #12306
Comments
What version did you use having that issue? Having an output of The feature exists from 1.33 via #6521 so far I can tell. The function There is also a snapshot test to verify the behavior. The input is:
And output be like:
So it looks like the issue shouldn't happen. I wonder if the entry of your |
@weihanglo I added the I also tried to reproduce the problem and found the following: If The following
|
Thanks for the reply. I think your reproduction is correct. However, |
Problem
When running
cargo init
in an existing git repository, cargo adds a/target
line to.gitignore
, regardless of whether that line is already present.Proposed Solution
After checking if the
.gitignore
file exists, scan the lines to search for a/target
,target/
or*/taget
line.Notes
cargo -vV
output:The text was updated successfully, but these errors were encountered: