Skip to contentSkip to conversation

Git.pm: Remove PerlIO usage from Git.xs

PATCH New Petr Baudis 1 participant 1 message Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

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.

---

 perl/Git.pm |   14 +++++++++++++-
 perl/Git.xs |   56 +++++++++++++++++++++++++-------------------------------
 2 files changed, 38 insertions(+), 32 deletions(-)
perl/Git.pm +13 -1
index 0581447..b4ee88b 100644
@@ -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