File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -28,14 +28,14 @@ thiserror = "1.0.26"
28
28
bstr = { version = " 0.2.13" , default-features = false }
29
29
30
30
document-features = { version = " 0.2.0" , optional = true }
31
- symlink = " 0.1.0"
32
31
33
32
[target .'cfg(unix)' .dependencies ]
34
33
libc = " 0.2.119"
35
34
36
35
[dev-dependencies ]
37
36
git-testtools = { path = " ../tests/tools" }
38
37
git-odb = { path = " ../git-odb" }
38
+ symlink = " 0.1.0"
39
39
40
40
walkdir = " 2.3.2"
41
41
tempfile = " 3.2.0"
Original file line number Diff line number Diff line change @@ -15,7 +15,6 @@ pub fn remove_symlink(path: &Path) -> io::Result<()> {
15
15
// TODO: use the `symlink` crate once it can delete directory symlinks
16
16
#[ cfg( windows) ]
17
17
pub fn remove_symlink ( path : & Path ) -> io:: Result < ( ) > {
18
- dbg ! ( path, std:: fs:: symlink_metadata( path) , std:: fs:: metadata( path) ) ;
19
18
if let Ok ( meta) = std:: fs:: metadata ( path) {
20
19
if meta. is_file ( ) {
21
20
std:: fs:: remove_file ( path) // this removes the link itself
Original file line number Diff line number Diff line change @@ -235,7 +235,10 @@ fn overwriting_files_and_lone_directories_works() {
235
235
) ;
236
236
237
237
let symlink = destination. path ( ) . join ( "dir/sub-dir/symlink" ) ;
238
- assert ! ( std:: fs:: symlink_metadata( & symlink) . unwrap( ) . is_symlink( ) , ) ;
238
+ assert_eq ! (
239
+ std:: fs:: symlink_metadata( & symlink) . unwrap( ) . is_symlink( ) ,
240
+ opts. fs. symlink
241
+ ) ;
239
242
assert_eq ! ( std:: fs:: read( symlink) . unwrap( ) , b"other content" ) ;
240
243
}
241
244
@@ -290,16 +293,17 @@ fn keep_going_collects_results() {
290
293
. iter( )
291
294
. map( |r| r. path. to_path_lossy( ) . into_owned( ) )
292
295
. collect:: <Vec <_>>( ) ,
293
- paths( if opts . fs . symlink {
296
+ paths( if cfg! ( unix ) {
294
297
[ "dir/content" , "empty" ]
295
298
} else {
296
- [ "dir/content" , "dir/sub-dir/symlink" ] // not actually a symlink anymore
299
+ // not actually a symlink anymore, even though symlinks are supported but git think differently.
300
+ [ "dir/content" , "dir/sub-dir/symlink" ]
297
301
} )
298
302
) ;
299
303
300
304
assert_eq ! (
301
305
stripped_prefix( & destination, & dir_structure( & destination) ) ,
302
- paths( if opts . fs . symlink {
306
+ paths( if cfg! ( unix ) {
303
307
[ "dir/sub-dir/symlink" , "executable" ]
304
308
} else {
305
309
[ "empty" , "executable" ]
You can’t perform that action at this time.
0 commit comments