Skip to content

Commit 29ecb7f

Browse files
committed
fix(vendor)!: vendor files with .rej/.orig suffix
This is meant to fixes #13191 As git sources and registry sources are considered immutable. I don't think there is any reason excluding those files. There might be a little chance local Git repositories might have those, though that is a rare use case. Alternatively, we could reject all `.rej`/`.orig` files but `Cargo.toml.orig`.
1 parent 622d4c2 commit 29ecb7f

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/cargo/ops/vendor.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -618,10 +618,6 @@ fn vendor_this(relative: &Path) -> bool {
618618
// Temporary Cargo files
619619
Some(".cargo-ok") => false,
620620

621-
// Skip patch-style orig/rej files. Published crates on crates.io
622-
// have `Cargo.toml.orig` which we don't want to use here and
623-
// otherwise these are rarely used as part of the build process.
624-
Some(p) if p.ends_with(".orig") || p.ends_with(".rej") => false,
625621
_ => true,
626622
}
627623
}

tests/testsuite/vendor.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1087,13 +1087,14 @@ fn ignore_files() {
10871087
Package::new("url", "1.4.1")
10881088
// These will be vendored
10891089
.file(".cargo_vcs_info.json", "")
1090+
.file("Cargo.toml.orig", "")
1091+
.file("foo.orig", "")
1092+
.file("foo.rej", "")
10901093
.file("src/lib.rs", "")
10911094
// These will not be vendored
10921095
.file(".cargo-ok", "")
10931096
.file(".gitattributes", "")
10941097
.file(".gitignore", "")
1095-
.file("foo.orig", "")
1096-
.file("foo.rej", "")
10971098
.publish();
10981099

10991100
p.cargo("vendor --respect-source-config").run();
@@ -1105,6 +1106,9 @@ fn ignore_files() {
11051106
"files": {
11061107
".cargo_vcs_info.json": "[..]",
11071108
"Cargo.toml": "[..]",
1109+
"Cargo.toml.orig": "[..]",
1110+
"foo.orig": "[..]",
1111+
"foo.rej": "[..]",
11081112
"src/lib.rs": "[..]"
11091113
},
11101114
"package": "[..]"

0 commit comments

Comments
 (0)