Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 2a54f88

Browse files
committedMar 15, 2023
chore: fix target dir ignore in generated gitignore
1 parent 4a3c588 commit 2a54f88

File tree

10 files changed

+11
-11
lines changed

10 files changed

+11
-11
lines changed
 

‎src/cargo/ops/cargo_new.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ fn mk(config: &Config, opts: &MkOptions<'_>) -> CargoResult<()> {
742742
// Using the push method with multiple arguments ensures that the entries
743743
// for all mutually-incompatible VCS in terms of syntax are in sync.
744744
let mut ignore = IgnoreList::new();
745-
ignore.push("/target", "^target/", "target");
745+
ignore.push("/target/", "^target/", "target");
746746
if !opts.bin {
747747
ignore.push("/Cargo.lock", "^Cargo.lock$", "Cargo.lock");
748748
}
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/target
1+
/target/
22
/Cargo.lock
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/target
1+
/target/
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/target
1+
/target/
22
/Cargo.lock

‎tests/testsuite/init/git_ignore_exists_no_conflicting_entries/out/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22

33
# Added by cargo
44

5-
/target
5+
/target/
66
/Cargo.lock
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
/target
1+
/target/
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/target
1+
/target/
22
/Cargo.lock
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/target
2-
/Cargo.lock
1+
/target/
2+
/Cargo.lock
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
/target
1+
/target/
22
**/some.file

‎tests/testsuite/init/simple_git_ignore_exists/out/.gitignore

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/target
1+
/target/
22
**/some.file
33

44
# Added by cargo

0 commit comments

Comments
 (0)
Please sign in to comment.