danchr created this revision. Herald added a reviewer: hg-reviewers. Herald added a subscriber: mercurial-patches.
REPOSITORY rHG Mercurial BRANCH default REVISION DETAIL https://phab.mercurial-scm.org/D9670 AFFECTED FILES rust/hg-core/src/utils/path_auditor.rs CHANGE DETAILS diff --git a/rust/hg-core/src/utils/path_auditor.rs b/rust/hg-core/src/utils/path_auditor.rs --- a/rust/hg-core/src/utils/path_auditor.rs +++ b/rust/hg-core/src/utils/path_auditor.rs @@ -206,6 +206,7 @@ let base_dir = tempdir().unwrap(); let base_dir_path = base_dir.path(); + let skip = base_dir_path.components().count() - 1; let a = base_dir_path.join("a"); let b = base_dir_path.join("b"); create_dir(&a).unwrap(); @@ -215,7 +216,7 @@ // TODO make portable std::os::unix::fs::symlink(&a, &b).unwrap(); - let buf = b.join("in_a").components().skip(2).collect::<PathBuf>(); + let buf = b.join("in_a").components().skip(skip).collect::<PathBuf>(); eprintln!("buf: {}", buf.display()); let path = path_to_hg_path_buf(buf).unwrap(); assert_eq!( To: danchr, #hg-reviewers Cc: mercurial-patches, mercurial-devel _______________________________________________ Mercurial-devel mailing list Mercurial-devel@mercurial-scm.org https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel