diff options
Diffstat (limited to '')
-rw-r--r-- | pkgs/by-name/ba/back/src/config/mod.rs | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/pkgs/by-name/ba/back/src/config/mod.rs b/pkgs/by-name/ba/back/src/config/mod.rs index 789c0b0..832d060 100644 --- a/pkgs/by-name/ba/back/src/config/mod.rs +++ b/pkgs/by-name/ba/back/src/config/mod.rs @@ -79,11 +79,17 @@ pub struct BackRepository { impl BackRepository { pub fn open(&self, scan_path: &Path) -> Result<ThreadSafeRepository, error::Error> { - let repo = ThreadSafeRepository::open(scan_path.join(&self.repo_path)).map_err(|err| { - Error::RepoOpen { - repository_path: self.repo_path.to_owned(), - error: Box::new(err), + let path = { + let base = scan_path.join(&self.repo_path); + if base.is_dir() { + base + } else { + PathBuf::from(base.display().to_string() + ".git") } + }; + let repo = ThreadSafeRepository::open(path).map_err(|err| Error::RepoOpen { + repository_path: self.repo_path.to_owned(), + error: Box::new(err), })?; if is_git_bug(&repo.to_thread_local())? { Ok(repo) |