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
175
175
( git_project, repo)
176
176
}
177
177
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
-
192
178
/// Add all files in the working directory to the git index.
193
179
pub fn add ( repo : & git2:: Repository ) {
194
180
// FIXME(libgit2/libgit2#2514): apparently, `add_all` will add all submodules
Original file line number Diff line number Diff line change 2
2
3
3
use cargo:: core:: Edition ;
4
4
use cargo_test_support:: compare:: assert_match_exact;
5
- use cargo_test_support:: git;
5
+ use cargo_test_support:: git:: { self , init } ;
6
6
use cargo_test_support:: paths:: { self , CargoPathExt } ;
7
7
use cargo_test_support:: registry:: { Dependency , Package } ;
8
8
use cargo_test_support:: tools;
@@ -773,8 +773,10 @@ commit the changes to these files:
773
773
774
774
#[ cargo_test]
775
775
fn 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 ( ) ) ;
778
780
779
781
p. cargo ( "fix" )
780
782
. with_status ( 101 )
You can’t perform that action at this time.
0 commit comments