]> git.proxmox.com Git - cargo.git/commitdiff
Fix HgRepo::discover
authorDale Wijnand <dale.wijnand@gmail.com>
Thu, 26 Jul 2018 07:49:03 +0000 (08:49 +0100)
committerDale Wijnand <dale.wijnand@gmail.com>
Thu, 26 Jul 2018 07:52:07 +0000 (08:52 +0100)
Replace the duplicate .cwd call with an invocation taken from
https://stackoverflow.com/a/3138925/463761

Match the semantics of the other vcs calls, which is invoke from 'cwd'
targeting 'path'. Looks a little confusing because hg takes a '--cwd'
argument.

src/cargo/util/vcs.rs

index 1eb447a5951e690fd0659b2780d87af942c450a5..53ffbba7775b3c7df084b404e0cf54a863c8f08d 100644 (file)
@@ -28,8 +28,9 @@ impl HgRepo {
     pub fn discover(path: &Path, cwd: &Path) -> CargoResult<HgRepo> {
         process("hg")
             .cwd(cwd)
+            .arg("--cwd")
+            .arg(path)
             .arg("root")
-            .cwd(path)
             .exec_with_output()?;
         Ok(HgRepo)
     }