From 9a3fa573f2f471218247476d3b3ad5fde08df29d Mon Sep 17 00:00:00 2001 From: Mica White Date: Sun, 29 Mar 2026 15:48:31 -0400 Subject: Autosave daemon --- src/lib.rs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 2882039..caa69b8 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,14 +1,4 @@ /* - * git-init-autosave: - * - generate local repo UUID - * - add repo to autosave configuration (optionally) - * - * git-autosave: - * - convert workdir to tree - * - note hostname - * - commit workdir to `refs/autosave/{UUID}-{branch}` - * - push autosave ref to branch upstream - * * git-autosave-daemon: * - watch configuration directory * - watch configured repositories @@ -49,6 +39,8 @@ use serde::{Deserialize, Serialize}; use thiserror::Error; use uuid::Uuid; +pub mod authenticate; + #[derive(Default, Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] pub struct Config { repositories: HashSet, @@ -57,6 +49,10 @@ pub struct Config { } impl Config { + pub fn repositories(&self) -> &HashSet { + &self.repositories + } + pub fn username_for_url(&self, url: &str) -> Option<&String> { self.passwords.get(url)?.0.as_ref() } -- cgit v1.2.3