Procházet zdrojové kódy

Merge pull request #243 from tobyzxj/patch-1

Using strings.HasPrefix(...) will cause a misjudgement
无闻 před 10 roky
rodič
revize
2da9908e29
1 změnil soubory, kde provedl 3 přidání a 3 odebrání
  1. 3 3
      models/repo.go

+ 3 - 3
models/repo.go

@@ -831,11 +831,11 @@ func GetCollaborativeRepos(uname string) ([]*Repository, error) {
 
 	repos := make([]*Repository, 0, 10)
 	for _, access := range accesses {
-		if strings.HasPrefix(access.RepoName, uname) {
+		infos := strings.Split(access.RepoName, "/")
+		if infos[0] == uname {
 			continue
 		}
-
-		infos := strings.Split(access.RepoName, "/")
+		
 		u, err := GetUserByName(infos[0])
 		if err != nil {
 			return nil, err