File tree Expand file tree Collapse file tree 3 files changed +6
-3
lines changed
gix-odb/src/store_impls/dynamic Expand file tree Collapse file tree 3 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,10 @@ mod empty_upwards_until_boundary {
3434 let dir = tempfile:: tempdir ( ) ?;
3535 let target = dir. path ( ) . join ( "actually-a-file" ) ;
3636 std:: fs:: write ( & target, [ 42 ] ) ?;
37- assert ! ( remove:: empty_upward_until_boundary( & target, dir. path( ) ) . is_err( ) ) ; // TODO: check for IsNotADirectory when it becomes stable
37+
38+ let res = remove:: empty_upward_until_boundary ( & target, dir. path ( ) ) ;
39+ assert ! ( res. is_err( ) ) ;
40+ assert ! ( res. err( ) . unwrap( ) . kind( ) == io:: ErrorKind :: NotADirectory ) ;
3841 assert ! ( target. is_file( ) , "it didn't touch the file" ) ;
3942 assert ! ( dir. path( ) . is_dir( ) , "it won't touch the boundary" ) ;
4043 Ok ( ( ) )
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ fn io_err_is_dir(err: &std::io::Error) -> bool {
6868 let raw = err. raw_os_error ( ) ;
6969 raw == Some ( if cfg ! ( windows) { 5 } else { 21 } ) /* Not a directory */
7070 /* Also that, but under different circumstances */
71- || raw == Some ( 20 )
71+ || raw == Some ( 20 ) || err . kind ( ) == std :: io :: ErrorKind :: NotADirectory
7272}
7373
7474/// Instantiation
Original file line number Diff line number Diff line change @@ -89,7 +89,7 @@ impl Store {
8989 ) ?;
9090 if !objects_dir. is_dir ( ) {
9191 return Err ( std:: io:: Error :: new (
92- std:: io:: ErrorKind :: Other , // TODO: use NotADirectory when stabilized
92+ std:: io:: ErrorKind :: NotADirectory ,
9393 format ! ( "'{}' wasn't a directory" , objects_dir. display( ) ) ,
9494 ) ) ;
9595 }
You can’t perform that action at this time.
0 commit comments