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.
This commit is contained in:
Dale Wijnand 2018-07-26 08:49:03 +01:00
parent 191bfbfaf2
commit 36cd1c3219
No known key found for this signature in database
GPG Key ID: 4F256E3D151DF5EF

View 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)
}