summaryrefslogtreecommitdiffstats
path: root/routers/web/repo/blame.go
diff options
context:
space:
mode:
authorLunny Xiao <xiaolunwen@gmail.com>2024-02-24 14:55:19 +0800
committerGitHub <noreply@github.com>2024-02-24 06:55:19 +0000
commitb79c30435f439af8243ee281310258cdf141e27b (patch)
tree43ffc1c750b427434e52880e8969dffc6aaaed33 /routers/web/repo/blame.go
parent4ba642d07d50d7eb42ae33cd6f1f7f2c82c02a40 (diff)
downloadgitea-b79c30435f439af8243ee281310258cdf141e27b.tar.gz
gitea-b79c30435f439af8243ee281310258cdf141e27b.zip
Use the database object format name but not read from git repoisitory everytime and fix possible migration wrong objectformat when migrating a sha256 repository (#29294)
Now we can get object format name from git command line or from the database repository table. Assume the column is right, we don't need to read from git command line every time. This also fixed a possible bug that the object format is wrong when migrating a sha256 repository from external. <img width="658" alt="image" src="https://github.com/go-gitea/gitea/assets/81045/6e9a9dcf-13bf-4267-928b-6bf2c2560423">
Diffstat (limited to 'routers/web/repo/blame.go')
-rw-r--r--routers/web/repo/blame.go7
1 files changed, 2 insertions, 5 deletions
diff --git a/routers/web/repo/blame.go b/routers/web/repo/blame.go
index c7875ea0cb..7602b30d2b 100644
--- a/routers/web/repo/blame.go
+++ b/routers/web/repo/blame.go
@@ -132,11 +132,8 @@ type blameResult struct {
}
func performBlame(ctx *context.Context, repoPath string, commit *git.Commit, file string, bypassBlameIgnore bool) (*blameResult, error) {
- objectFormat, err := ctx.Repo.GitRepo.GetObjectFormat()
- if err != nil {
- ctx.NotFound("CreateBlameReader", err)
- return nil, err
- }
+ objectFormat := ctx.Repo.GetObjectFormat()
+
blameReader, err := git.CreateBlameReader(ctx, objectFormat, repoPath, commit, file, bypassBlameIgnore)
if err != nil {
return nil, err