Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show in Web UI if file is vendored and generated #28620

Merged
merged 12 commits into from
Jan 24, 2024
Prev Previous commit
Next Next commit
Update routers/web/repo/view.go
Co-authored-by: delvh <dev.lh@web.de>
  • Loading branch information
JakobDev and delvh authored Jan 23, 2024
commit d78ccda954e70679f11bdfd176ed71578478fa2a
16 changes: 5 additions & 11 deletions routers/web/repo/view.go
Original file line number Diff line number Diff line change
Expand Up @@ -602,17 +602,11 @@ func renderFile(ctx *context.Context, entry *git.TreeEntry, treeLink, rawLink st
defer deferable()
attrs, err := checker.CheckPath(ctx.Repo.TreePath)
if err == nil {
if vendored, has := attrs["linguist-vendored"]; has {
if vendored == "set" || vendored == "true" {
ctx.Data["IsVendored"] = true
}
}

if generated, has := attrs["linguist-generated"]; has {
if generated == "set" || generated == "true" {
ctx.Data["IsGenerated"] = true
}
}
vendored, has := attrs["linguist-vendored"]
ctx.Data["IsVendored"] = has && (vendored == "set" || vendored == "true")

generated, has := attrs["linguist-generated"]
ctx.Data["IsGenerated"] = has && (generated == "set" || generated == "true")
}
}
}
Expand Down
Loading