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:
parent
f635f4652e
commit
13090769db
@ -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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user