File tree 1 file changed +13
-1
lines changed
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;
444
444
foreach my $commit (@commits )
445
445
{
446
446
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 ` ;
448
448
die " git error" if $? ;
449
449
chomp (@affected );
450
450
push (@files ,@affected );
@@ -453,11 +453,23 @@ foreach my $commit (@commits)
453
453
# remove excluded files from the file list
454
454
process_exclude();
455
455
456
+ my %processed ;
457
+
456
458
foreach my $source_filename (@files )
457
459
{
460
+ # skip duplicates
461
+ next if $processed {$source_filename };
462
+ $processed {$source_filename } = 1;
463
+
458
464
# ignore anything that's not a .c or .h file
459
465
next unless $source_filename =~ / \. [ch]$ / ;
460
466
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
+ }
461
473
# Automatically ignore .c and .h files that correspond to a .y or .l
462
474
# file. indent tends to get badly confused by Bison/flex output,
463
475
# and there's no value in indenting derived files anyway.
You can’t perform that action at this time.
0 commit comments