File tree 1 file changed +5
-6
lines changed 1 file changed +5
-6
lines changed Original file line number Diff line number Diff line change @@ -3162,10 +3162,10 @@ src/main.rs
3162
3162
fn include_files_called_target_git ( ) {
3163
3163
// https://github.com/rust-lang/cargo/issues/12790
3164
3164
// files and folders called "target" should be included, unless they're the actual target directory
3165
- let ( p, repo) = git:: new_repo ( "target_uncommitted " , |p| init_and_add_inner_target ( p) ) ;
3165
+ let ( p, repo) = git:: new_repo ( "foo " , |p| init_and_add_inner_target ( p) ) ;
3166
3166
// add target folder but not committed.
3167
- let _ = fs:: create_dir_all ( & repo . workdir ( ) . unwrap ( ) . join ( "target/foo.txt" ) ) . unwrap ( ) ;
3168
-
3167
+ _ = fs:: create_dir ( p . build_dir ( ) ) . unwrap ( ) ;
3168
+ _ = fs :: write ( p . build_dir ( ) . join ( "foo.txt" ) , "" ) . unwrap ( ) ;
3169
3169
p. cargo ( "package -l" )
3170
3170
. with_stdout (
3171
3171
"\
@@ -3183,9 +3183,8 @@ src/main.rs
3183
3183
. run ( ) ;
3184
3184
3185
3185
// if target is committed, it should be include.
3186
- let p = git:: new ( "target_committed" , |p| {
3187
- init_and_add_inner_target ( p) . file ( "target/foo.txt" , "" )
3188
- } ) ;
3186
+ git:: add ( & repo) ;
3187
+ git:: commit ( & repo) ;
3189
3188
p. cargo ( "package -l" )
3190
3189
. with_stdout (
3191
3190
"\
You can’t perform that action at this time.
0 commit comments