Suppress spurious warnings in --dry-run mode
[dupemerge] / faster-dupemerge
index 683ed32917c6a72d8e15b52fc1e5aadc518b2b95..fe23f8e70619443a8cc6fb3637dc6c07354b6ba5 100755 (executable)
@@ -355,6 +355,7 @@ hash_file:
                foreach my $filename (sort keys(%{$inode_to_file_name{$candidate}})) {
                        print STDERR "\t\tDigesting file $filename\n" if $debug;
                        if ((-l $filename) || ! -f _) {
+                               print STDERR "\n" if $progress;
                                warn "Bogon file " . tick_quote($filename);
                                $input_bogons++;
                                delete $inode_to_file_name{$candidate}->{$filename};
@@ -540,7 +541,7 @@ candidate_file:
 
                                                                        if ($link_done) {
                                                                                delete $inode_to_file_name{$to_inode}->{$to_file};
-                                                                               $inode_to_file_name{$from_inode}->{$to_file} = undef;
+                                                                               $inode_to_file_name{$from_inode}->{$to_file} = undef unless ($dry_run);
                                                                                $hash_to_inode{$digest} = [ $from_inode ];
 
                                                                                $hard_links++;