From: Ian Jackson Date: Mon, 11 May 2015 07:57:33 +0000 (+0100) Subject: git_for_each_ref: Fix FH handling X-Git-Tag: debian/0.30~179 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=dgit.git;a=commitdiff_plain;h=2ed034f34fe81fcdb2232d8d7a5e7c02dcb091dd;hp=68fecefcb822012c8eaef19c4368a674111df509 git_for_each_ref: Fix FH handling --- diff --git a/Debian/Dgit.pm b/Debian/Dgit.pm index 112d15bb..507bcca8 100644 --- a/Debian/Dgit.pm +++ b/Debian/Dgit.pm @@ -59,12 +59,12 @@ sub git_for_each_ref ($$) { # calls $func->($objid,$objtype,$fullrefname,$reftail); # $reftail is RHS of ref after refs/\w+/ # breaks if $pattern matches any ref `refs/blah' where blah has no `/' - my $fh = new IO::File "-|", qw(git for-each-ref), $pattern or die $!; - while (<$fh>) { + open GFER, "-|", qw(git for-each-ref), $pattern or die $!; + while () { m#^(\w+)\s+(\w+)\s+(refs/\w+/(\S+))\s# or die "$_ ?"; $func->($1,$2,$3,$4); } - $!=0; $?=0; close $fh or die "$pattern $? $!"; + $!=0; $?=0; close GFER or die "$pattern $? $!"; } sub git_for_each_tag_referring ($$) {