File tree Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Expand file tree Collapse file tree 1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -444,7 +444,7 @@ File::Find::find({wanted => $wanted}, @ARGV) if @ARGV;
444444foreach my $commit (@commits )
445445{
446446 my $prev =" $commit ~" ;
447- my @affected =` git diff-tree --no-commit-id --name-only -r $commit $prev ` ;
447+ my @affected =` git diff --diff-filter=ACMR --name-only $prev $commit ` ;
448448 die " git error" if $? ;
449449 chomp (@affected );
450450 push (@files ,@affected );
@@ -453,11 +453,23 @@ foreach my $commit (@commits)
453453# remove excluded files from the file list
454454process_exclude();
455455
456+ my %processed ;
457+
456458foreach my $source_filename (@files )
457459{
460+ # skip duplicates
461+ next if $processed {$source_filename };
462+ $processed {$source_filename } = 1;
463+
458464 # ignore anything that's not a .c or .h file
459465 next unless $source_filename =~ / \. [ch]$ / ;
460466
467+ # don't try to indent a file that doesn't exist
468+ unless (-f $source_filename )
469+ {
470+ warn " Could not find $source_filename " ;
471+ next ;
472+ }
461473 # Automatically ignore .c and .h files that correspond to a .y or .l
462474 # file. indent tends to get badly confused by Bison/flex output,
463475 # and there's no value in indenting derived files anyway.
You can’t perform that action at this time.
0 commit comments