From d3331c591e3e94347e2b9fd5f7f65ab0219eef77 Mon Sep 17 00:00:00 2001 From: Meng Zhang Date: Mon, 23 Oct 2023 18:41:52 -0700 Subject: [PATCH] fix(TAB-251): local url should be in format of file:///path/to/repo --- crates/tabby-common/src/config.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/tabby-common/src/config.rs b/crates/tabby-common/src/config.rs index 69f7b66..673e1ed 100644 --- a/crates/tabby-common/src/config.rs +++ b/crates/tabby-common/src/config.rs @@ -50,7 +50,7 @@ pub struct Repository { impl Repository { pub fn dir(&self) -> PathBuf { if self.is_local_dir() { - let path = self.git_url.strip_prefix("file:/").unwrap(); + let path = self.git_url.strip_prefix("file://").unwrap(); path.into() } else { repositories_dir().join(filenamify(&self.git_url)) @@ -75,7 +75,7 @@ mod tests { #[test] fn it_parses_local_dir() { let repo = Repository { - git_url: "file://home/user".to_owned(), + git_url: "file:///home/user".to_owned(), }; assert!(repo.is_local_dir()); assert_eq!(repo.dir().display().to_string(), "/home/user");