diff --git a/Cargo.toml b/Cargo.toml index eae3606..0ebd08a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -10,6 +10,7 @@ anyhow = "1.0.93" app_dirs2 = "2.5.5" clap = "4.5.21" futures-macro = "0.3.31" +gitoxide = "0.39.0" keyring = { version = "3.6.1", features = ["apple-native", "windows-native", "sync-secret-service"] } num-derive = "0.4.2" num-traits = "0.2.19" diff --git a/README.md b/README.md new file mode 100644 index 0000000..4ab354e --- /dev/null +++ b/README.md @@ -0,0 +1,3 @@ +```bash +brew install git-lfs +``` \ No newline at end of file diff --git a/src/git_lfs/git_lfs_parser.rs b/src/git_lfs/git_lfs_parser.rs index de81bf2..21b5137 100644 --- a/src/git_lfs/git_lfs_parser.rs +++ b/src/git_lfs/git_lfs_parser.rs @@ -2,6 +2,7 @@ use std::io; use anyhow::{bail, Result}; use serde::{Deserialize, Serialize}; +use tracing::{debug, info}; use super::CustomTransferAgent; @@ -81,10 +82,14 @@ impl<'custom_transfer_agent, T: CustomTransferAgent> GitLfsParser<'custom_transf let stdin = io::stdin(); stdin.read_line(&mut buffer)?; + debug!("Received JSON: \"{}\".", buffer); let event = self.parse(&serde_json::from_str::(buffer.as_str())?)?; let init_result = match event.event { - EventType::Init => self.custom_transfer_agent.init(&event).await, + EventType::Init => { + info!("Calling init on custom transfer agent."); + self.custom_transfer_agent.init(&event).await + }, _ => bail!("Event type was not init.") }; @@ -95,12 +100,20 @@ impl<'custom_transfer_agent, T: CustomTransferAgent> GitLfsParser<'custom_transf loop { stdin.read_line(&mut buffer)?; + debug!("Received JSON: \"{}\".", buffer); let event = self.parse(&serde_json::from_str::(buffer.as_str())?)?; match event.event { - EventType::Download => self.custom_transfer_agent.download(&event).await?, - EventType::Upload => self.custom_transfer_agent.upload(&event).await?, + EventType::Download => { + info!("Calling download on custom transfer agent."); + self.custom_transfer_agent.download(&event).await? + }, + EventType::Upload => { + info!("Calling upload on custom transfer agent."); + self.custom_transfer_agent.upload(&event).await? + }, EventType::Terminate => { + info!("Calling terminate on custom transfer agent."); self.custom_transfer_agent.terminate().await?; break;