@@ -11,6 +11,7 @@ import (
11
11
"strconv"
12
12
"strings"
13
13
14
+ repo_model "code.gitea.io/gitea/models/repo"
14
15
user_model "code.gitea.io/gitea/models/user"
15
16
"code.gitea.io/gitea/modules/charset"
16
17
"code.gitea.io/gitea/modules/git"
@@ -105,7 +106,7 @@ func RefBlame(ctx *context.Context) {
105
106
106
107
bypassBlameIgnore , _ := strconv .ParseBool (ctx .FormString ("bypass-blame-ignore" ))
107
108
108
- result , err := performBlame (ctx , ctx .Repo .Repository . RepoPath () , ctx .Repo .Commit , fileName , bypassBlameIgnore )
109
+ result , err := performBlame (ctx , ctx .Repo .Repository , ctx .Repo .Commit , fileName , bypassBlameIgnore )
109
110
if err != nil {
110
111
ctx .NotFound (err )
111
112
return
@@ -130,10 +131,10 @@ type blameResult struct {
130
131
FaultyIgnoreRevsFile bool
131
132
}
132
133
133
- func performBlame (ctx * context.Context , repoPath string , commit * git.Commit , file string , bypassBlameIgnore bool ) (* blameResult , error ) {
134
+ func performBlame (ctx * context.Context , repo * repo_model. Repository , commit * git.Commit , file string , bypassBlameIgnore bool ) (* blameResult , error ) {
134
135
objectFormat := ctx .Repo .GetObjectFormat ()
135
136
136
- blameReader , err := git .CreateBlameReader (ctx , objectFormat , repoPath , commit , file , bypassBlameIgnore )
137
+ blameReader , err := git .CreateBlameReader (ctx , objectFormat , repo . RepoPath () , commit , file , bypassBlameIgnore )
137
138
if err != nil {
138
139
return nil , err
139
140
}
@@ -149,7 +150,7 @@ func performBlame(ctx *context.Context, repoPath string, commit *git.Commit, fil
149
150
if len (r .Parts ) == 0 && r .UsesIgnoreRevs {
150
151
// try again without ignored revs
151
152
152
- blameReader , err = git .CreateBlameReader (ctx , objectFormat , repoPath , commit , file , true )
153
+ blameReader , err = git .CreateBlameReader (ctx , objectFormat , repo . RepoPath () , commit , file , true )
153
154
if err != nil {
154
155
return nil , err
155
156
}
0 commit comments