summaryrefslogtreecommitdiff
path: root/libpiny
diff options
context:
space:
mode:
authorJulian Blake Kongslie <jblake@omgwallhack.org>2011-05-31 01:32:28 -0700
committerJulian Blake Kongslie <jblake@omgwallhack.org>2011-05-31 01:32:28 -0700
commite3e183e46ecda3a8d388bf8c5ef07f1f4dbc6e97 (patch)
tree73dde95d1652e64e86e9a07679b35f989edb2295 /libpiny
parent6239ca4595858262ac42a5e743d76653c9e61c4a (diff)
downloadpiny-code-e3e183e46ecda3a8d388bf8c5ef07f1f4dbc6e97.tar.gz
piny-code-e3e183e46ecda3a8d388bf8c5ef07f1f4dbc6e97.zip
Hopefully better validation of local repos.
Diffstat (limited to 'libpiny')
-rw-r--r--libpiny/lib/Piny/Repo.pm7
1 files changed, 6 insertions, 1 deletions
diff --git a/libpiny/lib/Piny/Repo.pm b/libpiny/lib/Piny/Repo.pm
index e018e37..4e1b767 100644
--- a/libpiny/lib/Piny/Repo.pm
+++ b/libpiny/lib/Piny/Repo.pm
@@ -479,7 +479,12 @@ sub create {
system( "/bin/rm", "-r", $repo->path ) and die "Failed to clean up after failed clone operation!";
die( "Could not clone repository!\n" );
} else {
- if( Piny::Repo->new( $remote ) ) {
+ my $valid = 0;
+ eval {
+ Piny::Repo->new( $remote )->config->_conf;
+ $valid = 1;
+ };
+ if( $valid ) {
copy( $remote . ".git/config", $repo->path . "/config" ) or die "Config copy failed: $!";
} else {
print( "$remote is not local, unable to copy config file.");