@@ -500,12 +500,12 @@ impl HealthCommand {
500500 }
501501
502502 // Check for stale branches
503- if let Ok ( stale_count) = Self :: count_stale_branches ( ) {
504- if stale_count > 0 {
505- issues . push ( format ! (
506- "⚠️ {stale_count} potentially stale branches found"
507- ) ) ;
508- }
503+ if let Ok ( stale_count) = Self :: count_stale_branches ( )
504+ && stale_count > 0
505+ {
506+ issues . push ( format ! (
507+ "⚠️ {stale_count} potentially stale branches found"
508+ ) ) ;
509509 }
510510
511511 issues
@@ -560,14 +560,14 @@ impl HealthCommand {
560560 // Use git count-objects for repository size
561561 if let Ok ( output) = GitOperations :: run ( & [ "count-objects" , "-vH" ] ) {
562562 for line in output. lines ( ) {
563- if line. starts_with ( "size-pack" ) {
564- if let Some ( size_str) = line. split_whitespace ( ) . nth ( 1 ) {
565- // Parse size and check if it's concerning
566- if size_str . ends_with ( "GiB" ) || size_str . contains ( "1024" ) {
567- issues . push ( format ! (
568- "⚠️ Repository size: {size_str} (consider cleanup)"
569- ) ) ;
570- }
563+ if line. starts_with ( "size-pack" )
564+ && let Some ( size_str) = line. split_whitespace ( ) . nth ( 1 )
565+ {
566+ // Parse size and check if it's concerning
567+ if size_str . ends_with ( "GiB" ) || size_str . contains ( "1024" ) {
568+ issues . push ( format ! (
569+ "⚠️ Repository size: {size_str} (consider cleanup)"
570+ ) ) ;
571571 }
572572 }
573573 }
@@ -714,29 +714,29 @@ impl HealthCommand {
714714 files_checked += 1 ;
715715
716716 // Use filesystem metadata instead of external commands
717- if let Ok ( metadata) = std:: fs:: metadata ( file) {
718- if metadata. is_file ( ) {
719- let size = metadata . len ( ) ;
720-
721- // Simple heuristic: consider it binary if it's over 1MB or has certain extensions
722- let is_likely_binary = size > 1_000_000
723- || file . ends_with ( ".exe" )
724- || file. ends_with ( ".dll " )
725- || file. ends_with ( ".so " )
726- || file. ends_with ( ".dylib " )
727- || file. ends_with ( ".bin " )
728- || file. ends_with ( ".jpg " )
729- || file. ends_with ( ".png " )
730- || file. ends_with ( ".gif " )
731- || file. ends_with ( ".pdf " )
732- || file. ends_with ( ".zip" ) ;
733-
734- if is_likely_binary {
735- binary_count += 1 ;
736-
737- if size > 1_000_000 {
738- large_files . push ( ( file . to_string ( ) , size ) ) ;
739- }
717+ if let Ok ( metadata) = std:: fs:: metadata ( file)
718+ && metadata. is_file ( )
719+ {
720+ let size = metadata . len ( ) ;
721+
722+ // Simple heuristic: consider it binary if it's over 1MB or has certain extensions
723+ let is_likely_binary = size > 1_000_000
724+ || file. ends_with ( ".exe " )
725+ || file. ends_with ( ".dll " )
726+ || file. ends_with ( ".so " )
727+ || file. ends_with ( ".dylib " )
728+ || file. ends_with ( ".bin " )
729+ || file. ends_with ( ".jpg " )
730+ || file. ends_with ( ".png " )
731+ || file. ends_with ( ".gif " )
732+ || file. ends_with ( ".pdf" )
733+ || file . ends_with ( ".zip" ) ;
734+
735+ if is_likely_binary {
736+ binary_count += 1 ;
737+
738+ if size > 1_000_000 {
739+ large_files . push ( ( file . to_string ( ) , size ) ) ;
740740 }
741741 }
742742 }
0 commit comments