mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-28 12:46:09 +01:00
Merge pull request #243 from tobyzxj/patch-1
Using strings.HasPrefix(...) will cause a misjudgement
This commit is contained in:
commit
2da9908e29
|
@ -831,11 +831,11 @@ func GetCollaborativeRepos(uname string) ([]*Repository, error) {
|
||||||
|
|
||||||
repos := make([]*Repository, 0, 10)
|
repos := make([]*Repository, 0, 10)
|
||||||
for _, access := range accesses {
|
for _, access := range accesses {
|
||||||
if strings.HasPrefix(access.RepoName, uname) {
|
infos := strings.Split(access.RepoName, "/")
|
||||||
|
if infos[0] == uname {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
infos := strings.Split(access.RepoName, "/")
|
|
||||||
u, err := GetUserByName(infos[0])
|
u, err := GetUserByName(infos[0])
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
|
|
Loading…
Reference in a new issue