mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 22:28:05 +01:00 
			
		
		
		
	In history (from some legacy frameworks), both `:name` and `name` are supported as path path name, `:name` is an alias to `name`. To make code consistent, now we should only use `name` but not `:name`. Also added panic check in related functions to make sure the name won't be abused in case some downstreams still use them.
		
			
				
	
	
		
			19 lines
		
	
	
		
			484 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			19 lines
		
	
	
		
			484 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)
 | |
| 	}
 | |
| }
 |