From 34b99a51c370750b208ae07121a5d5c1b3f92360 Mon Sep 17 00:00:00 2001 From: Lucien Greathouse Date: Tue, 30 Apr 2019 23:06:59 -0700 Subject: [PATCH] Relax debug assert in IMFS, since paths can alias now --- server/src/imfs.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/server/src/imfs.rs b/server/src/imfs.rs index 0672ddb1..db8ebcd5 100644 --- a/server/src/imfs.rs +++ b/server/src/imfs.rs @@ -89,11 +89,13 @@ impl Imfs { pub fn add_root(&mut self, path: &Path) -> Result<(), FsError> { debug_assert!(path.is_absolute()); - debug_assert!(!self.is_within_roots(path)); - self.roots.insert(path.to_path_buf()); + if !self.is_within_roots(path) { + self.roots.insert(path.to_path_buf()); + self.descend_and_read_from_disk(path)?; + } - self.descend_and_read_from_disk(path) + Ok(()) } pub fn remove_root(&mut self, path: &Path) {