Skip to content
Browse files

Win32 compat, RT#52677

  • Loading branch information...
1 parent c64dd2c commit a36645677d155e0ae7dc500505f73d5cd54377e6 @bobtfish committed Dec 21, 2009
Showing with 10 additions and 3 deletions.
  1. +4 −1 CHANGES
  2. +2 −1 lib/Git/PurePerl.pm
  3. +1 −0 lib/Git/PurePerl/Loose.pm
  4. +2 −1 lib/Git/PurePerl/Pack.pm
  5. +1 −0 lib/Git/PurePerl/Pack/WithIndex.pm
View
5 CHANGES
@@ -1,13 +1,16 @@
Revision history for Perl module Git::PurePerl:
+0.45 Mon 21st Dec 12:36:29 GMT 2009
+ - Be Win32 compatible (RT#52677), patch contributed by kmx.
+
0.44 Sat 19th Dec 15:31:00 GMT
- Fix ref_sha1 to return rather than calling next as not in a loop. (doy)
- Add support for the special HEAD ref, and associated head and
head_sha1 methods
- Grok symbolic references
- Default to the current directory in the checkout method
-0.43 Wed 25 Nov 2009 19:46:38 GMT
+0.43 Wed 25 Nov 2009 19:46:38 GMT 2009
- Switch to Module::Install so we can have repository metadata in
META.yml
- No other changes from the previous 0.42_01 dev release.
View
3 lib/Git/PurePerl.pm
@@ -34,7 +34,7 @@ use Git::PurePerl::Protocol;
use IO::Digest;
use IO::Socket::INET;
use Path::Class;
-our $VERSION = '0.44';
+our $VERSION = '0.45';
$VERSION = eval $VERSION;
has 'directory' => (
@@ -450,6 +450,7 @@ sub clone {
sub _add_file {
my ( $class, $filename, $contents ) = @_;
my $fh = $filename->openw || confess "Error opening to $filename: $!";
+ binmode($fh); #important for Win32
$fh->print($contents) || confess "Error writing to $filename: $!";
$fh->close || confess "Error closing $filename: $!";
}
View
1 lib/Git/PurePerl/Loose.pm
@@ -38,6 +38,7 @@ sub put_object {
$filename->parent->mkpath;
my $compressed = compress( $object->raw );
my $fh = $filename->openw;
+ binmode($fh); #important for Win32
$fh->print($compressed) || die "Error writing to $filename: $!";
}
View
3 lib/Git/PurePerl/Pack.pm
@@ -26,6 +26,7 @@ my $SHA1Size = 20;
sub BUILD {
my $self = shift;
my $fh = IO::File->new( $self->filename ) || confess($!);
+ $fh->binmode();
$self->fh($fh);
}
@@ -91,7 +92,7 @@ sub read_compressed {
$fh->read( my $block, 4096 ) || die $!;
my $status = $deflate->inflate( $block, $out );
}
- confess "$out is not $size" unless length($out) == $size;
+ confess length($out)." is not $size" unless length($out) == $size;
$fh->seek( $offset + $deflate->total_in, 0 ) || die $!;
return $out;
View
1 lib/Git/PurePerl/Pack/WithIndex.pm
@@ -17,6 +17,7 @@ sub BUILD {
$self->index_filename($index_filename);
my $index_fh = IO::File->new($index_filename) || confess($!);
+ $index_fh->binmode();
$index_fh->read( my $signature, 4 );
$index_fh->read( my $version, 4 );
$version = unpack( 'N', $version );

0 comments on commit a366456

Please sign in to comment.
Something went wrong with that request. Please try again.