mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 08:30:25 +08:00 
			
		
		
		
	Ensure that blob-excerpt links work for wiki (#18587)
It appears that the blob-excerpt links do not work on the wiki - likely since their introduction. This PR adds support for the wiki on these links. Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
		@@ -787,6 +787,15 @@ func ExcerptBlob(ctx *context.Context) {
 | 
			
		||||
	direction := ctx.FormString("direction")
 | 
			
		||||
	filePath := ctx.FormString("path")
 | 
			
		||||
	gitRepo := ctx.Repo.GitRepo
 | 
			
		||||
	if ctx.FormBool("wiki") {
 | 
			
		||||
		var err error
 | 
			
		||||
		gitRepo, err = git.OpenRepositoryCtx(ctx, ctx.Repo.Repository.WikiPath())
 | 
			
		||||
		if err != nil {
 | 
			
		||||
			ctx.ServerError("OpenRepository", err)
 | 
			
		||||
			return
 | 
			
		||||
		}
 | 
			
		||||
		defer gitRepo.Close()
 | 
			
		||||
	}
 | 
			
		||||
	chunkSize := gitdiff.BlobExcerptChunkSize
 | 
			
		||||
	commit, err := gitRepo.GetCommit(commitID)
 | 
			
		||||
	if err != nil {
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user