send-email: use lexical filehandle for opendir
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 30 Sep 2010 13:42:54 +0000 (13:42 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 30 Sep 2010 19:20:31 +0000 (12:20 -0700)
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>
git-send-email.perl

index 8cc416115569e38317e63d1638d361d579518b73..2f18d83074b70a7ed31b6ce4fe07d5d0c48afcb3 100755 (executable)
@@ -512,12 +512,12 @@ while (defined(my $f = shift @ARGV)) {
                push @rev_list_opts, "--", @ARGV;
                @ARGV = ();
        } elsif (-d $f and !check_file_rev_conflict($f)) {
-               opendir(DH,$f)
+               opendir my $dh, $f
                        or die "Failed to opendir $f: $!";
 
                push @files, grep { -f $_ } map { catfile($f, $_) }
-                               sort readdir(DH);
-               closedir(DH);
+                               sort readdir $dh;
+               closedir $dh;
        } elsif ((-f $f or -p $f) and !check_file_rev_conflict($f)) {
                push @files, $f;
        } else {