summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libpiny/lib/Piny/Repo.pm10
1 files changed, 7 insertions, 3 deletions
diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm
index 031558e..41987c5 100644
--- a/libpiny/lib/Piny/Repo.pm
+++ b/libpiny/lib/Piny/Repo.pm
@@ -464,7 +464,9 @@ sub _change_owner {
sub all_repos {
my ( $class, $dir ) = @_;
- $dir = $s->config->piny_gitpath unless defined $dir;
+ my $config = Piny::Config->new( );
+
+ $dir = $config->piny_gitpath unless defined $dir;
my @ret;
@@ -492,7 +494,7 @@ sub create {
mkdir( $repo->path ) or die "The repo $name appears to already exist! ($!)";
- chdir( $s->config->piny_gitpath ); # so git-clone can do the work of resolving local repo names for us
+ chdir( $repo->config->piny_gitpath ); # so git-clone can do the work of resolving local repo names for us
if ( defined $remote ) {
system( "/bin/chown", $user->name, $repo->path ) and die "Could not change ownership of repo path!"; # permissions are overridden later
if ( system( "/usr/bin/sudo", "-H", "-u", $user->name, "/usr/bin/git", "clone", "--bare", "--no-hardlinks", "--quiet", $remote, $repo->path ) ) { # sudo -u $user needed in order to test user readability of whatever they want to clone. the mode o+rx should probably be masked off if we want private repos to stay private.
@@ -577,7 +579,9 @@ sub _build_group {
sub _build_path {
my ( $s ) = @_;
- return $s->config->piny_gitpath . $s->name . ".git";
+ my $config = Piny::Config->new( ); # New, otherwise we'd wind up recursing. It's considered global anyway.
+
+ return $config->piny_gitpath . "/" . $s->name . ".git";
};
sub _build_description {