File tree Expand file tree Collapse file tree 4 files changed +31
-1
lines changed Expand file tree Collapse file tree 4 files changed +31
-1
lines changed Original file line number Diff line number Diff line change @@ -14,6 +14,7 @@ resources repository => 'git://github.com/bobtfish/git-pureperl.git';
14
14
requires ' Archive::Extract' => ' 0' ;
15
15
requires ' Compress::Raw::Zlib' => ' 0' ;
16
16
requires ' Compress::Zlib' => ' 0' ;
17
+ requires ' Config::GitLike' => ' 0' ;
17
18
requires ' Data::Stream::Bulk' => ' 0' ;
18
19
requires ' DateTime' => ' 0' ;
19
20
requires ' Digest::SHA1' => ' 0' ;
Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ use DateTime;
10
10
use Digest::SHA1;
11
11
use File::Find::Rule;
12
12
use Git::PurePerl::Actor;
13
+ use Git::PurePerl::Config;
13
14
use Git::PurePerl::DirectoryEntry;
14
15
use Git::PurePerl::Loose;
15
16
use Git::PurePerl::Object;
@@ -76,6 +77,16 @@ has 'description' => (
76
77
}
77
78
);
78
79
80
+ has ' config' => (
81
+ is => ' ro' ,
82
+ isa => ' Git::PurePerl::Config' ,
83
+ lazy => 1,
84
+ default => sub {
85
+ my $self = shift ;
86
+ Git::PurePerl::Config-> new(git => $self );
87
+ }
88
+ );
89
+
79
90
__PACKAGE__ -> meta-> make_immutable;
80
91
81
92
sub BUILDARGS {
Original file line number Diff line number Diff line change
1
+ package Git::PurePerl::Config ;
2
+ use Moose;
3
+ use MooseX::StrictConstructor;
4
+ use Moose::Util::TypeConstraints;
5
+
6
+ extends ' Config::GitLike' ;
7
+
8
+ has ' +confname' => ( default => " gitconfig" );
9
+ has ' git' => ( is => ' ro' , isa => ' Git::PurePerl' , required => 1 );
10
+
11
+ override dir_file => sub {
12
+ my $self = shift ;
13
+ return $self -> git-> gitdir-> file(" config" );
14
+ };
15
+
16
+ 1;
Original file line number Diff line number Diff line change 1
1
# !perl
2
2
use strict;
3
3
use warnings;
4
- use Test::More tests => 198 ;
4
+ use Test::More tests => 201 ;
5
5
use Git::PurePerl;
6
6
use Path::Class;
7
7
@@ -102,6 +102,8 @@ hello world, again
102
102
is( $git -> all_sha1s-> all, 9 );
103
103
is( $git -> all_objects-> all, 9 );
104
104
105
+ is( $git -> config-> get(key => ' user.name' ), ' Your Name Comes Here' );
106
+
105
107
$checkout_directory -> rmtree;
106
108
$checkout_directory -> mkpath;
107
109
$git -> checkout($checkout_directory );
You can’t perform that action at this time.
0 commit comments