summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoe Rayhawk <jrayhawk@omgwallhack.org>2011-05-02 21:09:11 -0700
committerJoe Rayhawk <jrayhawk@omgwallhack.org>2011-05-02 21:09:11 -0700
commite8a45817104834f42bdf039c4466569f23f675d1 (patch)
treebe3023b1a515d7f7083a5ee89ff605430970391d
parenta6f148c4c72b0242ed11a52cf6b2ad30bbeb2028 (diff)
downloadpiny-code-e8a45817104834f42bdf039c4466569f23f675d1.tar.gz
piny-code-e8a45817104834f42bdf039c4466569f23f675d1.zip
Yeah, we probably shouldn't randomly truncate packed-refs.
-rw-r--r--libpiny/lib/Piny/Repo.pm12
1 files changed, 8 insertions, 4 deletions
diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm
index be363bd..b81f9bf 100644
--- a/libpiny/lib/Piny/Repo.pm
+++ b/libpiny/lib/Piny/Repo.pm
@@ -225,8 +225,10 @@ sub rebuild {
my $ikiuser = Piny::User::IkiWiki->new( "name" => "iki-" . $s->shortname );
foreach( "git-daemon-export-ok", "packed-refs" ) {
- open( TOUCH, ">", $s->path . "/" . $_ ) or die "Could not touch $_ for repo: $!";
- close( TOUCH );
+ unless( -e $s->path . "/" . $_ ) {
+ open( TOUCH, ">", $s->path . "/" . $_ ) or die "Could not touch $_ for repo: $!";
+ close( TOUCH );
+ };
};
foreach( "info", "logs", "branches" ) {
@@ -393,8 +395,10 @@ sub create {
system( "/usr/bin/git", "init", "--template=/srv/git-template.git", "--quiet", "--shared" ) and die "Could not initialize git repo!";
foreach( "git-daemon-export-ok", "packed-refs" ) {
- open( TOUCH, ">", $repo->path . "/" . $_ ) or die "Could not touch $_ for repo: $!";
- close( TOUCH );
+ unless( -e $s->path . "/" . $_ ) {
+ open( TOUCH, ">", $repo->path . "/" . $_ ) or die "Could not touch $_ for repo: $!";
+ close( TOUCH );
+ };
};
foreach( "info", "logs" ) {