summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorMica White <botahamec@outlook.com>2026-03-29 15:48:31 -0400
committerMica White <botahamec@outlook.com>2026-03-29 15:48:31 -0400
commit9a3fa573f2f471218247476d3b3ad5fde08df29d (patch)
tree4be264e3d6137d69043cf111a945cd10a8f7897c /src/lib.rs
parent604d3be6dc04892cdef71935d1117855c1cc7bb4 (diff)
Autosave daemon
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs16
1 files changed, 6 insertions, 10 deletions
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<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()
}