rust/hg-core/src/dirstate/dirs_multiset.rs
changeset 44283 934a79697c36
parent 44267 0e9ac3968b56
child 44973 26114bd6ec60
--- a/rust/hg-core/src/dirstate/dirs_multiset.rs	Wed Jan 22 12:11:35 2020 -0500
+++ b/rust/hg-core/src/dirstate/dirs_multiset.rs	Fri Jan 24 11:10:07 2020 +0100
@@ -12,7 +12,7 @@
     dirstate::EntryState,
     utils::{
         files,
-        hg_path::{HgPath, HgPathBuf},
+        hg_path::{HgPath, HgPathBuf, HgPathError},
     },
     DirstateEntry, DirstateMapError, FastHashMap,
 };
@@ -78,7 +78,14 @@
             if subpath.as_bytes().last() == Some(&b'/') {
                 // TODO Remove this once PathAuditor is certified
                 // as the only entrypoint for path data
-                return Err(DirstateMapError::ConsecutiveSlashes);
+                let second_slash_index = subpath.len() - 1;
+
+                return Err(DirstateMapError::InvalidPath(
+                    HgPathError::ConsecutiveSlashes {
+                        bytes: path.as_ref().as_bytes().to_owned(),
+                        second_slash_index,
+                    },
+                ));
             }
             if let Some(val) = self.inner.get_mut(subpath) {
                 *val += 1;