File tree Expand file tree Collapse file tree 3 files changed +30
-12
lines changed Expand file tree Collapse file tree 3 files changed +30
-12
lines changed Original file line number Diff line number Diff line change @@ -96,10 +96,10 @@ impl Capabilities {
96
96
}
97
97
98
98
let res = std:: fs:: symlink_metadata ( & link_path) . map ( |m| m. is_symlink ( ) ) ;
99
- let cleanup = std :: fs :: remove_file ( & src_path ) ;
100
- crate :: os:: remove_symlink ( & link_path)
101
- . or_else ( |_| std:: fs:: remove_file ( & link_path ) )
102
- . and ( cleanup ) ? ;
99
+
100
+ let cleanup = crate :: os:: remove_symlink ( & link_path) . or_else ( |_| std :: fs :: remove_file ( & link_path ) ) ;
101
+ std:: fs:: remove_file ( & src_path ) . and ( cleanup ) ? ;
102
+
103
103
res
104
104
}
105
105
}
Original file line number Diff line number Diff line change 44
44
path : dest. to_path_buf ( ) ,
45
45
} ) ?;
46
46
47
+ #[ cfg_attr( not( unix) , allow( unused_mut) ) ]
47
48
let mut options = open_options ( dest, destination_is_initially_empty, overwrite_existing) ;
48
49
let needs_executable_bit = executable_bit && entry. mode == git_index:: entry:: Mode :: FILE_EXECUTABLE ;
49
50
#[ cfg( unix) ]
Original file line number Diff line number Diff line change @@ -96,7 +96,6 @@ mod cache {
96
96
}
97
97
}
98
98
99
- use bstr:: ByteVec ;
100
99
#[ cfg( unix) ]
101
100
use std:: os:: unix:: prelude:: MetadataExt ;
102
101
use std:: {
@@ -286,20 +285,38 @@ fn keep_going_collects_results() {
286
285
. unwrap ( ) ;
287
286
288
287
assert_eq ! (
289
- stripped_prefix( & destination, & dir_structure( & destination) ) ,
290
- paths( [ "dir/sub-dir/symlink" , "executable" ] ) ,
291
- "some files could not be created"
288
+ outcome
289
+ . errors
290
+ . iter( )
291
+ . map(
292
+ |r| r. error. to_string( ) [ .."object 4f41554f6e0045ef53848fc0c3f33b6a9abc24a9 for checkout at " . len( ) ]
293
+ . to_owned( )
294
+ )
295
+ . collect:: <Vec <_>>( ) ,
296
+ [
297
+ "4f41554f6e0045ef53848fc0c3f33b6a9abc24a9" ,
298
+ "e69de29bb2d1d6434b8b29ae775ad8c2e48c5391"
299
+ ]
300
+ . iter( )
301
+ . map( |id| format!( "object {} for checkout at " , id) )
302
+ . collect:: <Vec <_>>( )
292
303
) ;
293
-
294
- assert ! ( outcome. collisions. is_empty( ) ) ;
295
304
assert_eq ! (
296
305
outcome
297
306
. errors
298
- . into_iter ( )
299
- . map( |r| Vec :: from ( r. path) . into_path_buf_lossy ( ) )
307
+ . iter ( )
308
+ . map( |r| r. path. to_path_lossy ( ) . into_owned ( ) )
300
309
. collect:: <Vec <_>>( ) ,
301
310
paths( [ "dir/content" , "empty" ] )
302
311
) ;
312
+
313
+ assert_eq ! (
314
+ stripped_prefix( & destination, & dir_structure( & destination) ) ,
315
+ paths( [ "dir/sub-dir/symlink" , "executable" ] ) ,
316
+ "some files could not be created"
317
+ ) ;
318
+
319
+ assert ! ( outcome. collisions. is_empty( ) ) ;
303
320
}
304
321
305
322
#[ test]
You can’t perform that action at this time.
0 commit comments