mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-11-04 13:34:43 +01:00 
			
		
		
		
	1. add `GetSiteCookieFlashMessage` to help to parse flash message 2. clarify `handleRepoHomeFeed` logic 3. remove unnecessary global variables, use `sync.OnceValue` instead 4. add some tests for `IsUsableUsername` and `IsUsableRepoName`
		
			
				
	
	
		
			19 lines
		
	
	
		
			481 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			481 B
		
	
	
	
		
			Go
		
	
	
	
	
	
// Copyright 2022 The Gitea Authors. All rights reserved.
 | 
						|
// SPDX-License-Identifier: MIT
 | 
						|
 | 
						|
package feed
 | 
						|
 | 
						|
import (
 | 
						|
	"code.gitea.io/gitea/services/context"
 | 
						|
)
 | 
						|
 | 
						|
// RenderBranchFeed render format for branch or file
 | 
						|
func RenderBranchFeed(ctx *context.Context) {
 | 
						|
	_, showFeedType := GetFeedType(ctx.PathParam("reponame"), ctx.Req)
 | 
						|
	if ctx.Repo.TreePath == "" {
 | 
						|
		ShowBranchFeed(ctx, ctx.Repo.Repository, showFeedType)
 | 
						|
	} else {
 | 
						|
		ShowFileFeed(ctx, ctx.Repo.Repository, showFeedType)
 | 
						|
	}
 | 
						|
}
 |