forked from acme/git-pureperl
-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support the file:// protocol, as well
- Loading branch information
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
package Git::PurePerl::Protocol::File; | ||
use Moose; | ||
use MooseX::StrictConstructor; | ||
use Moose::Util::TypeConstraints; | ||
use IPC::Open2; | ||
|
||
extends 'Git::PurePerl::Protocol'; | ||
|
||
has 'path' => ( is => 'ro', isa => 'Str', required => 1 ); | ||
|
||
sub connect_socket { | ||
my $self = shift; | ||
|
||
my ($read, $write); | ||
my $pid = open2( | ||
$read, $write, | ||
"git-upload-pack", | ||
$self->path, | ||
); | ||
|
||
$read->autoflush(1); | ||
$write->autoflush(1); | ||
$self->read_socket($read); | ||
$self->write_socket($write); | ||
} | ||
|
||
1; |