mod fixture; use std::convert::TryFrom; use std::iter::FromIterator; use anyhow::Result; use git2::Repository; use git_trim::args::{DeleteFilter, DeleteRange, Scope}; use git_trim::{ get_trim_plan, ClassifiedBranch, Git, LocalBranch, PlanParam, RemoteTrackingBranch, }; use fixture::{rc, test_default_param, Fixture}; fn fixture() -> Fixture { rc().append_fixture_trace( r#" git init origin --bare git clone origin local local < README.md git add README.md git commit -m "Initial commit" git push -u origin master EOF git clone origin contributer within contributer < PlanParam<'static> { PlanParam { delete: DeleteFilter::from_iter(vec![ DeleteRange::MergedLocal, DeleteRange::MergedRemote(Scope::Scoped("origin".to_string())), ]), ..test_default_param() } } #[test] fn test_default_config_tries_to_delete_accidential_track() -> Result<()> { let guard = fixture().prepare( "local", r#" local < Result<()> { let guard = fixture().prepare( "local", r#" local <