From 36cd1c32198faac620e0f5b2c875154ba079f87c Mon Sep 17 00:00:00 2001 From: Dale Wijnand Date: Thu, 26 Jul 2018 08:49:03 +0100 Subject: [PATCH] Fix HgRepo::discover 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 | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/cargo/util/vcs.rs b/src/cargo/util/vcs.rs index 1eb447a59..53ffbba77 100644 --- a/src/cargo/util/vcs.rs +++ b/src/cargo/util/vcs.rs @@ -28,8 +28,9 @@ impl HgRepo { pub fn discover(path: &Path, cwd: &Path) -> CargoResult { process("hg") .cwd(cwd) + .arg("--cwd") + .arg(path) .arg("root") - .cwd(path) .exec_with_output()?; Ok(HgRepo) } -- 2.39.5