summaryrefslogtreecommitdiff
path: root/perl/Git.pm
diff options
context:
space:
mode:
authorPetr Baudis <pasky@suse.cz>2006-07-01 23:38:56 (GMT)
committerJunio C Hamano <junkio@cox.net>2006-07-03 00:14:44 (GMT)
commite6634ac9841f8df3ce1c0c461c677faf2d59af3e (patch)
tree21037803f265201bc6e64b49a05e2821847fea88 /perl/Git.pm
parentb9795608c4d82ba119d78980b479d78bdfe753b6 (diff)
downloadgit-e6634ac9841f8df3ce1c0c461c677faf2d59af3e.zip
git-e6634ac9841f8df3ce1c0c461c677faf2d59af3e.tar.gz
git-e6634ac9841f8df3ce1c0c461c677faf2d59af3e.tar.bz2
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 <pasky@suse.cz> Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'perl/Git.pm')
-rw-r--r--perl/Git.pm14
1 files changed, 13 insertions, 1 deletions
diff --git a/perl/Git.pm b/perl/Git.pm
index 0581447..b4ee88b 100644
--- a/perl/Git.pm
+++ b/perl/Git.pm
@@ -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);
+ }
+}