summaryrefslogtreecommitdiff
path: root/libpiny/lib/Piny
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@omgwallhack.org>2011-05-07 00:05:45 -0700
committerJoe Rayhawk <jrayhawk@omgwallhack.org>2011-05-07 00:05:45 -0700
commit6c82877e08111ee56ff09d15a57208526aa3aea3 (patch)
tree0b1190d6f124bdde8054a7fb87269b6e4baa182d /libpiny/lib/Piny
parent62abed37202a4651d210c56cd2cdf88d5ac6aad7 (diff)
downloadpiny-code-6c82877e08111ee56ff09d15a57208526aa3aea3.tar.gz
piny-code-6c82877e08111ee56ff09d15a57208526aa3aea3.zip
Fix repo creation logic
Diffstat (limited to 'libpiny/lib/Piny')
-rw-r--r--libpiny/lib/Piny/Repo.pm8
1 files changed, 4 insertions, 4 deletions
diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm
index cb3754f..a26450f 100644
--- a/libpiny/lib/Piny/Repo.pm
+++ b/libpiny/lib/Piny/Repo.pm
@@ -397,14 +397,14 @@ sub create {
mkdir( $repo->path ) or die "The repo $name appears to already exist! ($!)";
+ $ENV{"GIT_DIR"} = $repo->path;
+ system( "/usr/bin/git", "init", "--bare", "--quiet", "--shared" ) and die "Could not initialize git repo!";
+ delete $ENV{"GIT_DIR"};
+
if ( defined $source ) {
$ENV{"GIT_DIR"} = $source;
system( "/usr/bin/git", "push", "--mirror", $repo->path ) and die "Could not push refs to new repository!";
delete $ENV{"GIT_DIR"};
- } else {
- $ENV{"GIT_DIR"} = $repo->path;
- system( "/usr/bin/git", "init", "--bare", "--quiet", "--shared" ) and die "Could not initialize git repo!";
- delete $ENV{"GIT_DIR"};
};
system( "/bin/chown", "-R", $user->name, $repo->path . "/objects" ) and die "Could not change ownership of $_ for repo: $!";