From: Kyle J. McKay Date: Wed, 7 Aug 2013 17:30:25 +0000 (-0700) Subject: Project.pm: allow _new for all does_exist projects X-Git-Url: https://repo.or.cz/w/girocco.git/commitdiff_plain/c4af00a99bd2e579c3f591481213e7d858d60765 Project.pm: allow _new for all does_exist projects The valid_name check is more restrictive than the does_exist check which prevents loading some projects that actually exist (e.g. a fork that has been kept but has had its forkee removed). If the project actually does_exist go ahead and allow the _new to succeed. --- diff --git a/Girocco/Project.pm b/Girocco/Project.pm index ce926f1..1208c59 100644 --- a/Girocco/Project.pm +++ b/Girocco/Project.pm @@ -306,7 +306,7 @@ sub _hooks_install { sub _new { my $class = shift; my ($name, $base_path, $path) = @_; - valid_name($name) or die "refusing to create project with invalid name ($name)!"; + does_exist($name,1) || valid_name($name) or die "refusing to create project with invalid name ($name)!"; $path ||= "$base_path/$name.git"; my $proj = { name => $name, base_path => $base_path, path => $path };