From b4db53cb9b245c5c6d717d39520b442a3f6b6785 Mon Sep 17 00:00:00 2001 From: Robin Gottschalk Date: Mon, 17 Feb 2025 23:17:34 +0100 Subject: [PATCH] Changed paths to match dragonfly laptop and disable push temporarily --- src/git.rs | 24 ++++++++++++------------ src/main.rs | 2 +- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/git.rs b/src/git.rs index a1ae6fa..e394dbe 100644 --- a/src/git.rs +++ b/src/git.rs @@ -66,19 +66,19 @@ pub fn backup_changes(repo_path: &Path) -> Result<(), Box &[&parent_commit], )?; - // Set up remote push with credentials callback - let mut callbacks = RemoteCallbacks::new(); - callbacks.credentials(move |_url, username, _allowed_types| { - let user = username.unwrap_or("git"); - let token = get_git_token(); - Cred::userpass_plaintext(user, &token) - }); + // // Set up remote push with credentials callback + // let mut callbacks = RemoteCallbacks::new(); + // callbacks.credentials(move |_url, username, _allowed_types| { + // let user = username.unwrap_or("git"); + // let token = get_git_token(); + // Cred::userpass_plaintext(user, &token) + // }); - // Push changes - let mut push_options = PushOptions::new(); - push_options.remote_callbacks(callbacks); - let mut remote = repo.find_remote("origin")?; - remote.push(&["refs/heads/main"], Some(&mut push_options))?; + // // Push changes + // let mut push_options = PushOptions::new(); + // push_options.remote_callbacks(callbacks); + // let mut remote = repo.find_remote("origin")?; + // remote.push(&["refs/heads/main"], Some(&mut push_options))?; println!("Changes committed and pushed successfully."); Ok(()) diff --git a/src/main.rs b/src/main.rs index 7f791b6..bd8166a 100644 --- a/src/main.rs +++ b/src/main.rs @@ -16,7 +16,7 @@ mod filesync; mod git; const PROTECT_PREFIX: &str = ".git"; // only at first directory level -const SOURCE_VAULT: &str = "D:\\Cloud\\Syncthing\\obsidian-vault"; // syncthing vault folder +const SOURCE_VAULT: &str = "C:\\Users\\robin\\Obsidian"; // syncthing vault folder const REPO_VAULT: &str = "C:\\Users\\robin\\AppData\\Roaming\\obsidian-git-backup\\obsidian-vault-clone"; // git repo folder const GIT_COMMIT_DELAY_AFTER_FILE_CHANGE: Duration = Duration::from_secs(5 * 60); // 5 min