From e3e183e46ecda3a8d388bf8c5ef07f1f4dbc6e97 Mon Sep 17 00:00:00 2001 From: Julian Blake Kongslie Date: Tue, 31 May 2011 01:32:28 -0700 Subject: Hopefully better validation of local repos. --- libpiny/lib/Piny/Repo.pm | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'libpiny/lib/Piny') 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."); -- cgit v1.2.3