mirror of
https://codeberg.org/forgejo/forgejo.git
synced 2025-08-07 10:55:22 +02:00
blame: count lines without reading blob
This commit is contained in:
parent
7086e7a9ac
commit
7a6b5b6dd9
1 changed files with 7 additions and 7 deletions
|
@ -82,19 +82,19 @@ func RefBlame(ctx *context.Context) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx.Data["NumLinesSet"] = true
|
|
||||||
ctx.Data["NumLines"], err = blob.GetBlobLineCount()
|
|
||||||
if err != nil {
|
|
||||||
ctx.ServerError("GetBlobLineCount", err)
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
result, err := performBlame(ctx, ctx.Repo.Commit, ctx.Repo.TreePath, ctx.FormBool("bypass-blame-ignore"))
|
result, err := performBlame(ctx, ctx.Repo.Commit, ctx.Repo.TreePath, ctx.FormBool("bypass-blame-ignore"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
ctx.ServerError("performBlame", err)
|
ctx.ServerError("performBlame", err)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ctx.Data["NumLinesSet"] = true
|
||||||
|
numLines := 0
|
||||||
|
for _, p := range result.Parts {
|
||||||
|
numLines += len(p.Lines)
|
||||||
|
}
|
||||||
|
ctx.Data["NumLines"] = numLines
|
||||||
|
|
||||||
ctx.Data["UsesIgnoreRevs"] = result.UsesIgnoreRevs
|
ctx.Data["UsesIgnoreRevs"] = result.UsesIgnoreRevs
|
||||||
ctx.Data["FaultyIgnoreRevsFile"] = result.FaultyIgnoreRevsFile
|
ctx.Data["FaultyIgnoreRevsFile"] = result.FaultyIgnoreRevsFile
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue