From 0ae4bf932c0808123d9e8149f5c7fedd10f6c2b7 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Mon, 9 Mar 2020 13:24:37 -0700 Subject: don't look up namespace if project already exists Signed-off-by: Sean Whitton --- lib/API/GitForge/GitLab.pm | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) (limited to 'lib/API') diff --git a/lib/API/GitForge/GitLab.pm b/lib/API/GitForge/GitLab.pm index 3f38bf7..2091cfc 100644 --- a/lib/API/GitForge/GitLab.pm +++ b/lib/API/GitForge/GitLab.pm @@ -113,13 +113,9 @@ sub _clean_config_fork { sub _ensure_repo { my ($self, $target) = @_; my ($ns, $repo) = _extract_project_id($target); - - # first we are required to get the namespace id + return if $self->{_api}->project($target); my $namespace = $self->{_api}->namespace($ns) or croak "invalid project namespace $ns"; - - # now create the project unless it already exists - return if $self->{_api}->project($target); $self->{_api} ->create_project({ name => $repo, namespace_id => $namespace->{id} }); } -- cgit v1.2.3