Skip to content

Commit 1023fa5

Browse files
committed
Auto merge of #10483 - cuviper:vcs--, r=Eh2406
Separate VCS command paths with "--" When building a VCS command, there may be ambiguity if a relative path looks like an option, like "-path" or "--path". All of the VCS commands that we use support a bare "--" separator for non-option arguments, which is good practice to apply here. This does not affect the cargo CLI, as it already makes sure to use absolute paths for these calls via `value_of_path()`.
2 parents 2ac382d + 58508e2 commit 1023fa5

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/cargo/util/vcs.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ impl HgRepo {
4545
ProcessBuilder::new("hg")
4646
.cwd(cwd)
4747
.arg("init")
48+
.arg("--")
4849
.arg(path)
4950
.exec()?;
5051
Ok(HgRepo)
@@ -65,6 +66,7 @@ impl PijulRepo {
6566
ProcessBuilder::new("pijul")
6667
.cwd(cwd)
6768
.arg("init")
69+
.arg("--")
6870
.arg(path)
6971
.exec()?;
7072
Ok(PijulRepo)
@@ -85,13 +87,15 @@ impl FossilRepo {
8587
ProcessBuilder::new("fossil")
8688
.cwd(cwd)
8789
.arg("init")
90+
.arg("--")
8891
.arg(&db_path)
8992
.exec()?;
9093

9194
// open it in that new directory
9295
ProcessBuilder::new("fossil")
9396
.cwd(&path)
9497
.arg("open")
98+
.arg("--")
9599
.arg(db_fname)
96100
.exec()?;
97101

0 commit comments

Comments
 (0)