mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	limit max commits view number on activity
This commit is contained in:
		
							
								
								
									
										4
									
								
								serve.go
									
									
									
									
									
								
							
							
						
						
									
										4
									
								
								serve.go
									
									
									
									
									
								
							@@ -262,9 +262,13 @@ func runServ(k *cli.Context) {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	commits := make([][]string, 0)
 | 
						commits := make([][]string, 0)
 | 
				
			||||||
 | 
						var maxCommits = 5
 | 
				
			||||||
	for e := l.Back(); e != nil; e = e.Prev() {
 | 
						for e := l.Back(); e != nil; e = e.Prev() {
 | 
				
			||||||
		commit := e.Value.(*git.Commit)
 | 
							commit := e.Value.(*git.Commit)
 | 
				
			||||||
		commits = append(commits, []string{commit.Id().String(), commit.Message()})
 | 
							commits = append(commits, []string{commit.Id().String(), commit.Message()})
 | 
				
			||||||
 | 
							if len(commits) >= maxCommits {
 | 
				
			||||||
 | 
								break
 | 
				
			||||||
 | 
							}
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	if err = models.CommitRepoAction(user.Id, user.Name,
 | 
						if err = models.CommitRepoAction(user.Id, user.Name,
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user