File tree Expand file tree Collapse file tree 2 files changed +5
-17
lines changed
crates/cargo-test-support/src Expand file tree Collapse file tree 2 files changed +5
-17
lines changed Original file line number Diff line number Diff line change @@ -175,20 +175,6 @@ where
175175 ( git_project, repo)
176176}
177177
178- /// Create a new git repository with a project.
179- /// Returns both the Project and the git Repository but does not commit.
180- pub fn new_repo_without_add_and_commit < F > ( name : & str , callback : F ) -> ( Project , git2:: Repository )
181- where
182- F : FnOnce ( ProjectBuilder ) -> ProjectBuilder ,
183- {
184- let mut git_project = project ( ) . at ( name) ;
185- git_project = callback ( git_project) ;
186- let git_project = git_project. build ( ) ;
187-
188- let repo = init ( & git_project. root ( ) ) ;
189- ( git_project, repo)
190- }
191-
192178/// Add all files in the working directory to the git index.
193179pub fn add ( repo : & git2:: Repository ) {
194180 // FIXME(libgit2/libgit2#2514): apparently, `add_all` will add all submodules
Original file line number Diff line number Diff line change 22
33use cargo:: core:: Edition ;
44use cargo_test_support:: compare:: assert_match_exact;
5- use cargo_test_support:: git;
5+ use cargo_test_support:: git:: { self , init } ;
66use cargo_test_support:: paths:: { self , CargoPathExt } ;
77use cargo_test_support:: registry:: { Dependency , Package } ;
88use cargo_test_support:: tools;
@@ -773,8 +773,10 @@ commit the changes to these files:
773773
774774#[ cargo_test]
775775fn errors_on_empty_repo ( ) {
776- let ( p, _) =
777- git:: new_repo_without_add_and_commit ( "foo" , |p| p. file ( "src/lib.rs" , "pub fn foo() {}" ) ) ;
776+ let mut git_project = project ( ) . at ( "foo" ) ;
777+ git_project = git_project. file ( "src/lib.rs" , "pub fn foo() {}" ) ;
778+ let p = git_project. build ( ) ;
779+ let _ = init ( & p. root ( ) ) ;
778780
779781 p. cargo ( "fix" )
780782 . with_status ( 101 )
You can’t perform that action at this time.
0 commit comments