mod fixture; use std::convert::TryFrom; use anyhow::Result; use git2::Repository; use git_trim::{get_trim_plan, ClassifiedBranch, Git, LocalBranch, RemoteTrackingBranch}; use fixture::{rc, test_default_param, Fixture}; fn fixture() -> Fixture { rc().append_fixture_trace( r#" git init origin origin < README.md git add README.md git commit -m "Initial commit" EOF git clone origin local local < Result<()> { let guard = fixture().prepare( "local", r#" origin < Result<()> { let guard = fixture().prepare( "local", r#" origin < Result<()> { let guard = fixture().prepare( "local", r#" origin < Result<()> { let guard = fixture().prepare( "local", r#" origin < Result<()> { let guard = fixture().prepare( "local", r#" origin < Result<()> { let guard = fixture().prepare( "local", r#" origin < Result<()> { let guard = fixture().prepare("local", r#""#)?; let git = Git::try_from(Repository::open(guard.working_directory())?)?; let plan = get_trim_plan(&git, &test_default_param())?; assert_eq!(plan.to_delete, set! {}); Ok(()) } #[test] fn test_rejected_but_forgot_to_delete_and_edited() -> Result<()> { let guard = fixture().prepare( "local", r#" local <