From 0352ada9d83467b04f46ccb65863893555c81fc3 Mon Sep 17 00:00:00 2001 From: asonix Date: Wed, 16 Aug 2023 16:39:41 -0500 Subject: [PATCH] Don't doulbe-open repo --- src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 15c0905..35723bf 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1844,8 +1844,6 @@ impl PictRsConfiguration { pub async fn run(self) -> color_eyre::Result<()> { let PictRsConfiguration { config, operation } = self; - let repo = Repo::open(config.repo.clone())?; - let client = build_client(&config)?; match operation { @@ -1855,6 +1853,8 @@ impl PictRsConfiguration { from, to, } => { + let repo = Repo::open(config.repo.clone())?; + match from { config::primitives::Store::Filesystem(config::Filesystem { path }) => { let from = FileStore::build(path.clone(), repo.clone()).await?; @@ -1925,6 +1925,8 @@ impl PictRsConfiguration { } } + let repo = Repo::open(config.repo.clone())?; + if config.server.read_only { tracing::warn!("Launching in READ ONLY mode"); }