diff options
| author | Mica White <botahamec@outlook.com> | 2026-04-03 20:41:13 -0400 |
|---|---|---|
| committer | Mica White <botahamec@outlook.com> | 2026-04-03 20:41:13 -0400 |
| commit | 02c306bf2cba2ecab1bcd33fb9a6b5de995163ee (patch) | |
| tree | 2ca16caa124ac2d43cc7da23591b9ec17c03f754 /src/bin/git-autosave.rs | |
| parent | 03d6d4846ffcd29e589fdecaddbc749217761bfe (diff) | |
Try a single-binary approach
Diffstat (limited to 'src/bin/git-autosave.rs')
| -rw-r--r-- | src/bin/git-autosave.rs | 26 |
1 files changed, 0 insertions, 26 deletions
diff --git a/src/bin/git-autosave.rs b/src/bin/git-autosave.rs deleted file mode 100644 index fa0d9e6..0000000 --- a/src/bin/git-autosave.rs +++ /dev/null @@ -1,26 +0,0 @@ -use auth_git2::GitAuthenticator; -use git_autosave::{Config, authenticate::Inquirer, commit_autosave, push_autosaves}; -use git2::{RemoteCallbacks, Repository}; - -fn main() -> Result<(), anyhow::Error> { - let repository = Repository::discover(".")?; - let gitconfig = repository.config()?; - let config: &'static mut Config = Box::leak(Box::new(Config::load()?)); - - if std::env::args().any(|arg| arg == "--init") { - let id = git_autosave::init(&repository, Some(config))?; - config.save()?; - println!("Initialized autosave for repository: {id}"); - } - - let auth = GitAuthenticator::new().set_prompter(Inquirer(config)); - let mut callbacks = RemoteCallbacks::new(); - callbacks.credentials(auth.credentials(&gitconfig)); - - let commit = commit_autosave(&repository)?; - println!("Commited autosave: {commit}"); - push_autosaves(&repository, callbacks)?; - println!("Successfully pushed autosave to remote"); - - Ok(()) -} |
