0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-05-08 14:33:54 +02:00

fix repo url parsing

This commit is contained in:
☙◦ The Tablet ❀ GamerGirlandCo ◦❧ 2025-11-23 17:03:55 -05:00
parent f635f4652e
commit 13090769db
No known key found for this signature in database
GPG Key ID: 924A5F6AF051E87C

View File

@ -132,13 +132,14 @@ func ParseRepositoryURL(ctx context.Context, repoURL string) (*RepositoryURL, er
if len(fields) >= 3 {
ret.GroupID, pathErr = strconv.ParseInt(fields[1], 10, 64)
if pathErr != nil {
return pathErr
ret.RepoName = strings.TrimSuffix(fields[1], ".git")
ret.RemainingPath = "/" + fields[2]
return nil
}
ret.RepoName = strings.TrimSuffix(fields[2], ".git")
ret.RemainingPath = "/" + fields[3]
} else {
ret.RepoName = strings.TrimSuffix(fields[1], ".git")
ret.RemainingPath = "/" + fields[2]
if len(fields) >= 4 {
ret.RemainingPath = "/" + fields[3]
}
}
}
return nil