summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2020-02-17 18:19:03 -0700
committerSean Whitton <spwhitton@spwhitton.name>2020-02-17 18:19:03 -0700
commit76ccdf33280379b26ec745def5edceb28043d925 (patch)
tree7bd2e5c2149dc36531cffcae36a24cb555811e68
parent03ae097e2fc526586eb5c409c325e6bb1caad52f (diff)
downloadp5-API-GitForge-76ccdf33280379b26ec745def5edceb28043d925.tar.gz
don't drop .git from $upstream in two places
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--lib/API/GitForge/GitLab.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/API/GitForge/GitLab.pm b/lib/API/GitForge/GitLab.pm
index b264eb9..12d318b 100644
--- a/lib/API/GitForge/GitLab.pm
+++ b/lib/API/GitForge/GitLab.pm
@@ -70,12 +70,11 @@ sub _ensure_fork {
sub _assert_fork_has_parent {
my ($self, $upstream) = @_;
- my (undef, $repo) = _extract_project_id($upstream);
+ my ($path, $repo) = _extract_project_id($upstream);
my $user = $self->{_api}->current_user->{username};
my $fork = $self->{_api}->project("$user/$repo");
- $upstream =~ s/\.git$//;
- $fork->{forked_from_project}{path_with_namespace} eq $upstream
+ $fork->{forked_from_project}{path_with_namespace} eq $path . "/" . $repo
or croak
"$user/$repo does not have parent $upstream; don't know what to do";
}