Git.pm: Remove PerlIO usage from Git.xs
PATCH 1/1 Git.pm: Remove PerlIO usage from Git.xs
PerlIO_*() is not portable before 5.7.3, according to ppport.h, and it's more clear what is going on when we do it in the Perl part of the Git module anyway.
Signed-off-by Petr Baudis <[email protected]>
---
perl/Git.pm | 14 +++++++++++++- perl/Git.xs | 56 +++++++++++++++++++++++++------------------------------- 2 files changed, 38 insertions(+), 32 deletions(-)
perl/Git.pm +13 -1
@@ -511,7 +511,19 @@ are involved. =cut -# Implemented in Git.xs. +sub hash_object { + my ($self, $type, $file) = _maybe_self(@_); + + # hash_object_* implemented in Git.xs. + + if (ref($file) eq 'GLOB') { + my $hash = hash_object_pipe($type, fileno($file)); + close $file; + return $hash; + } else { + hash_object_file($type, $file); + } +}
perl/Git.xs +25 -31
67 lines not on this page · raw message