diff options
author | Petr Baudis <pasky@suse.cz> | 2006-07-02 01:38:56 +0200 |
---|---|---|
committer | Junio C Hamano <junkio@cox.net> | 2006-07-02 17:14:44 -0700 |
commit | e6634ac9841f8df3ce1c0c461c677faf2d59af3e (patch) | |
tree | 21037803f265201bc6e64b49a05e2821847fea88 /perl/Git.pm | |
parent | b9795608c4d82ba119d78980b479d78bdfe753b6 (diff) | |
download | git-e6634ac9841f8df3ce1c0c461c677faf2d59af3e.tar.gz |
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.pm | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/perl/Git.pm b/perl/Git.pm index 0581447757..b4ee88bdfd 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); + } +} |