diff options
Diffstat (limited to 'src/lib.rs')
| -rw-r--r-- | src/lib.rs | 16 |
1 files changed, 6 insertions, 10 deletions
@@ -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<PathBuf>, @@ -57,6 +49,10 @@ pub struct Config { } impl Config { + pub fn repositories(&self) -> &HashSet<PathBuf> { + &self.repositories + } + pub fn username_for_url(&self, url: &str) -> Option<&String> { self.passwords.get(url)?.0.as_ref() } |
