Radish alpha
h
Radicle Heartwood Protocol & Stack
Radicle
Git (anonymous pull)
Log in to clone via SSH
Try to improve performance of repository open
cloudhead committed 2 years ago
commit cce46a3d8ba1bf2118da028b4c14b518cc03bfe1
parent 8e541dcf58c52902b6aeb42d37eee06e1c91b2e3
1 file changed +8 -1
modified radicle/src/storage/git.rs
@@ -374,7 +374,14 @@ pub enum Validation {
impl Repository {
    /// Open an existing repository.
    pub fn open<P: AsRef<Path>>(path: P, id: RepoId) -> Result<Self, RepositoryError> {
-
        let backend = git2::Repository::open_bare(path.as_ref())?;
+
        let backend = git2::Repository::open_ext(
+
            path.as_ref(),
+
            git2::RepositoryOpenFlags::empty()
+
                | git2::RepositoryOpenFlags::BARE
+
                | git2::RepositoryOpenFlags::NO_DOTGIT
+
                | git2::RepositoryOpenFlags::NO_SEARCH,
+
            &[] as &[&std::ffi::OsStr],
+
        )?;

        Ok(Self { id, backend })
    }