@@ -15,16 +15,16 @@ import (
15
15
)
16
16
17
17
type BlameGenerator struct {
18
+ ctx * sql.Context
18
19
commit * object.Commit
19
20
fIter * object.FileIter
20
21
curLine int
21
22
curFile * object.File
22
23
lines []* git.Line
23
- ctx * sql.Context
24
24
}
25
25
26
- func NewBlameGenerator (c * object. Commit , f * object.FileIter , ctx * sql. Context ) (* BlameGenerator , error ) {
27
- return & BlameGenerator {commit : c , fIter : f , curLine : - 1 , ctx : ctx }, nil
26
+ func NewBlameGenerator (ctx * sql. Context , c * object.Commit , f * object. FileIter ) (* BlameGenerator , error ) {
27
+ return & BlameGenerator {ctx : ctx , commit : c , fIter : f , curLine : - 1 }, nil
28
28
}
29
29
30
30
func (g * BlameGenerator ) loadNewFile () error {
@@ -36,8 +36,11 @@ func (g *BlameGenerator) loadNewFile() error {
36
36
37
37
result , err := git .Blame (g .commit , g .curFile .Name )
38
38
if err != nil {
39
- msg := fmt .Sprintf ("Error in BLAME for file %s: %s" ,
40
- g .curFile .Name , err .Error ())
39
+ msg := fmt .Sprintf (
40
+ "Error in BLAME for file %s: %s" ,
41
+ g .curFile .Name ,
42
+ err .Error (),
43
+ )
41
44
logrus .Warn (msg )
42
45
g .ctx .Warn (0 , msg )
43
46
return io .EOF
@@ -153,7 +156,7 @@ func (b *Blame) Eval(ctx *sql.Context, row sql.Row) (interface{}, error) {
153
156
return nil , err
154
157
}
155
158
156
- bg , err := NewBlameGenerator (commit , fIter , ctx )
159
+ bg , err := NewBlameGenerator (ctx , commit , fIter )
157
160
if err != nil {
158
161
return nil , err
159
162
}
0 commit comments