From ee8b1e9fce87097548b0cc0544077c192c81bca5 Mon Sep 17 00:00:00 2001 From: Paul Campbell Date: Sun, 21 Apr 2024 18:54:36 +0100 Subject: [PATCH] fix(config): deserialise gitdir as PathBuf, but expose it as GitDir --- src/server/config/mod.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/server/config/mod.rs b/src/server/config/mod.rs index e5942a7..0b96ffe 100644 --- a/src/server/config/mod.rs +++ b/src/server/config/mod.rs @@ -171,7 +171,7 @@ impl Display for ForgeConfig { pub struct ServerRepoConfig { repo: String, branch: String, - gitdir: Option, + gitdir: Option, main: Option, next: Option, dev: Option, @@ -199,8 +199,8 @@ impl ServerRepoConfig { _ => None, } } - pub const fn gitdir(&self) -> Option<&GitDir> { - self.gitdir.as_ref() + pub fn gitdir(&self) -> Option { + self.gitdir.clone().map(GitDir) } } #[cfg(test)] @@ -341,7 +341,7 @@ impl RepoDetails { repo_path: RepoPath(server_repo_config.repo.clone()), config: server_repo_config.repo_config(), branch: BranchName(server_repo_config.branch.clone()), - gitdir: server_repo_config.gitdir().cloned(), + gitdir: server_repo_config.gitdir(), forge: ForgeDetails { name: forge_name.clone(), forge_type: forge.forge_type.clone(),