summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-03-09 13:24:37 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-03-09 13:24:37 -0700
commit0ae4bf932c0808123d9e8149f5c7fedd10f6c2b7 (patch)
tree7e3d5df2bed023817d1773cfb500b402e160fae0 /lib
parenta7b92281eaa19d1d2e36c7d0fd4d1359a2469e99 (diff)
downloadp5-API-GitForge-0ae4bf932c0808123d9e8149f5c7fedd10f6c2b7.tar.gz
don't look up namespace if project already exists
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'lib')
-rw-r--r--lib/API/GitForge/GitLab.pm6
1 files changed, 1 insertions, 5 deletions
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} });
}