use reel::Repo; fn main() -> std::result::Result<(), Box> { println!("opening repo https://gitlab.com/crates-rs/reel.git"); let repo = Repo::new("https://gitlab.com/crates-rs/reel.git")?; println!("finding a specific commit 4d33e72088d6e18675005c85e4ad21de6e1ad326"); // Get a specific commit_id 4d33e72088d6e18675005c85e4ad21de6e1ad326 let c1 = repo.find("4d33e72088d6e18675005c85e4ad21de6e1ad326")?; println!("found commit 4d33e72088d6e18675005c85e4ad21de6e1ad326"); assert_eq!( "4d33e72088d6e18675005c85e4ad21de6e1ad326", c1.name(), "commit name" ); assert_eq!("Louis Parslow", c1.author_name(), "author_name"); assert_eq!("lou.parslow@gmail.com", c1.author_email(), "author_email"); assert_eq!("Initial commit", c1.message(), "message"); assert_eq!( "2020-07-12 20:44:22 UTC", c1.timestamp_utc().to_string(), "timestamp_utc.to_string()" ); let checkout_path = c1.checkout().unwrap(); assert!( checkout_path.exists(), "{:?} does not exist.", checkout_path ); Ok(()) }