@@ -799,30 +799,6 @@ sub is_format_patch_arg {
799
799
800
800
$time = time - scalar $#files ;
801
801
802
- if ($validate ) {
803
- # FIFOs can only be read once, exclude them from validation.
804
- my @real_files = ();
805
- foreach my $f (@files ) {
806
- unless (-p $f ) {
807
- push (@real_files , $f );
808
- }
809
- }
810
-
811
- # Run the loop once again to avoid gaps in the counter due to FIFO
812
- # arguments provided by the user.
813
- my $num = 1;
814
- my $num_files = scalar @real_files ;
815
- $ENV {GIT_SENDEMAIL_FILE_TOTAL } = " $num_files " ;
816
- foreach my $r (@real_files ) {
817
- $ENV {GIT_SENDEMAIL_FILE_COUNTER } = " $num " ;
818
- pre_process_file($r , 1);
819
- validate_patch($r , $target_xfer_encoding );
820
- $num += 1;
821
- }
822
- delete $ENV {GIT_SENDEMAIL_FILE_COUNTER };
823
- delete $ENV {GIT_SENDEMAIL_FILE_TOTAL };
824
- }
825
-
826
802
@files = handle_backup_files(@files );
827
803
828
804
if (@files ) {
@@ -1726,10 +1702,6 @@ sub send_message {
1726
1702
return 1;
1727
1703
}
1728
1704
1729
- $in_reply_to = $initial_in_reply_to ;
1730
- $references = $initial_in_reply_to || ' ' ;
1731
- $message_num = 0;
1732
-
1733
1705
sub pre_process_file {
1734
1706
my ($t , $quiet ) = @_ ;
1735
1707
@@ -1995,6 +1967,38 @@ sub process_file {
1995
1967
return 1;
1996
1968
}
1997
1969
1970
+ sub initialize_modified_loop_vars {
1971
+ $in_reply_to = $initial_in_reply_to ;
1972
+ $references = $initial_in_reply_to || ' ' ;
1973
+ $message_num = 0;
1974
+ }
1975
+
1976
+ if ($validate ) {
1977
+ # FIFOs can only be read once, exclude them from validation.
1978
+ my @real_files = ();
1979
+ foreach my $f (@files ) {
1980
+ unless (-p $f ) {
1981
+ push (@real_files , $f );
1982
+ }
1983
+ }
1984
+
1985
+ # Run the loop once again to avoid gaps in the counter due to FIFO
1986
+ # arguments provided by the user.
1987
+ my $num = 1;
1988
+ my $num_files = scalar @real_files ;
1989
+ $ENV {GIT_SENDEMAIL_FILE_TOTAL } = " $num_files " ;
1990
+ initialize_modified_loop_vars();
1991
+ foreach my $r (@real_files ) {
1992
+ $ENV {GIT_SENDEMAIL_FILE_COUNTER } = " $num " ;
1993
+ pre_process_file($r , 1);
1994
+ validate_patch($r , $target_xfer_encoding );
1995
+ $num += 1;
1996
+ }
1997
+ delete $ENV {GIT_SENDEMAIL_FILE_COUNTER };
1998
+ delete $ENV {GIT_SENDEMAIL_FILE_TOTAL };
1999
+ }
2000
+
2001
+ initialize_modified_loop_vars();
1998
2002
foreach my $t (@files ) {
1999
2003
while (!process_file($t )) {
2000
2004
# user edited the file
0 commit comments