File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed
Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -259,7 +259,11 @@ impl Chmoder {
259259 // Don't try to change the mode of the symlink itself
260260 continue ;
261261 }
262- if !self . quiet {
262+ if self . recursive {
263+ // With recursive, we should ignore dangling symlinks
264+ continue ;
265+ }
266+ if !self . recursive && !self . quiet {
263267 show ! ( USimpleError :: new(
264268 1 ,
265269 format!( "cannot operate on dangling symlink {}" , filename. quote( ) ) ,
Original file line number Diff line number Diff line change @@ -892,8 +892,9 @@ fn test_chmod_symlink_to_dangling_recursive() {
892892 . arg ( "755" )
893893 . arg ( "-R" )
894894 . arg ( symlink)
895- . fails ( )
896- . stderr_is ( "chmod: cannot operate on dangling symlink 'symlink'\n " ) ;
895+ . succeeds ( )
896+ . stdout_is ( "" )
897+ . stderr_is ( "" ) ;
897898 assert_eq ! (
898899 at. symlink_metadata( symlink) . permissions( ) . mode( ) ,
899900 get_expected_symlink_permissions( ) ,
You can’t perform that action at this time.
0 commit comments