Skip to content

Commit a366456

Browse files
committed
Win32 compat, RT#52677
1 parent c64dd2c commit a366456

File tree

5 files changed

+10
-3
lines changed

5 files changed

+10
-3
lines changed

CHANGES

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,16 @@
11
Revision history for Perl module Git::PurePerl:
22

3+
0.45 Mon 21st Dec 12:36:29 GMT 2009
4+
- Be Win32 compatible (RT#52677), patch contributed by kmx.
5+
36
0.44 Sat 19th Dec 15:31:00 GMT
47
- Fix ref_sha1 to return rather than calling next as not in a loop. (doy)
58
- Add support for the special HEAD ref, and associated head and
69
head_sha1 methods
710
- Grok symbolic references
811
- Default to the current directory in the checkout method
912

10-
0.43 Wed 25 Nov 2009 19:46:38 GMT
13+
0.43 Wed 25 Nov 2009 19:46:38 GMT 2009
1114
- Switch to Module::Install so we can have repository metadata in
1215
META.yml
1316
- No other changes from the previous 0.42_01 dev release.

lib/Git/PurePerl.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use Git::PurePerl::Protocol;
3434
use IO::Digest;
3535
use IO::Socket::INET;
3636
use Path::Class;
37-
our $VERSION = '0.44';
37+
our $VERSION = '0.45';
3838
$VERSION = eval $VERSION;
3939

4040
has 'directory' => (
@@ -450,6 +450,7 @@ sub clone {
450450
sub _add_file {
451451
my ( $class, $filename, $contents ) = @_;
452452
my $fh = $filename->openw || confess "Error opening to $filename: $!";
453+
binmode($fh); #important for Win32
453454
$fh->print($contents) || confess "Error writing to $filename: $!";
454455
$fh->close || confess "Error closing $filename: $!";
455456
}

lib/Git/PurePerl/Loose.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ sub put_object {
3838
$filename->parent->mkpath;
3939
my $compressed = compress( $object->raw );
4040
my $fh = $filename->openw;
41+
binmode($fh); #important for Win32
4142
$fh->print($compressed) || die "Error writing to $filename: $!";
4243
}
4344

lib/Git/PurePerl/Pack.pm

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ my $SHA1Size = 20;
2626
sub BUILD {
2727
my $self = shift;
2828
my $fh = IO::File->new( $self->filename ) || confess($!);
29+
$fh->binmode();
2930
$self->fh($fh);
3031
}
3132

@@ -91,7 +92,7 @@ sub read_compressed {
9192
$fh->read( my $block, 4096 ) || die $!;
9293
my $status = $deflate->inflate( $block, $out );
9394
}
94-
confess "$out is not $size" unless length($out) == $size;
95+
confess length($out)." is not $size" unless length($out) == $size;
9596

9697
$fh->seek( $offset + $deflate->total_in, 0 ) || die $!;
9798
return $out;

lib/Git/PurePerl/Pack/WithIndex.pm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ sub BUILD {
1717
$self->index_filename($index_filename);
1818

1919
my $index_fh = IO::File->new($index_filename) || confess($!);
20+
$index_fh->binmode();
2021
$index_fh->read( my $signature, 4 );
2122
$index_fh->read( my $version, 4 );
2223
$version = unpack( 'N', $version );

0 commit comments

Comments
 (0)