send-email: use lexical filehandle for opendir
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.comReviewed-by: Avery Pennarun <apenwarr@gmail.com> Reviewed-by: Jeff King <peff@peff.net> > Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
9855b08d35
commit
c6038169a7
|
@ -512,12 +512,12 @@ while (defined(my $f = shift @ARGV)) {
|
||||||
push @rev_list_opts, "--", @ARGV;
|
push @rev_list_opts, "--", @ARGV;
|
||||||
@ARGV = ();
|
@ARGV = ();
|
||||||
} elsif (-d $f and !check_file_rev_conflict($f)) {
|
} elsif (-d $f and !check_file_rev_conflict($f)) {
|
||||||
opendir(DH,$f)
|
opendir my $dh, $f
|
||||||
or die "Failed to opendir $f: $!";
|
or die "Failed to opendir $f: $!";
|
||||||
|
|
||||||
push @files, grep { -f $_ } map { catfile($f, $_) }
|
push @files, grep { -f $_ } map { catfile($f, $_) }
|
||||||
sort readdir(DH);
|
sort readdir $dh;
|
||||||
closedir(DH);
|
closedir $dh;
|
||||||
} elsif ((-f $f or -p $f) and !check_file_rev_conflict($f)) {
|
} elsif ((-f $f or -p $f) and !check_file_rev_conflict($f)) {
|
||||||
push @files, $f;
|
push @files, $f;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue