From a2139beb6916c436c791b193fa5f7400a71dde05 Mon Sep 17 00:00:00 2001 From: silverwind Date: Thu, 7 Jul 2022 22:28:26 +0200 Subject: [PATCH] Fix commit status icon when in subdirectory When viewing a subdirectory and the latest commit to that directory in the table, the commit status icon incorrectly showed the status of the HEAD commit instead of the latest for that directory. --- routers/web/repo/view.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/routers/web/repo/view.go b/routers/web/repo/view.go index c327f959f6556..b5cd5659a66b2 100644 --- a/routers/web/repo/view.go +++ b/routers/web/repo/view.go @@ -856,7 +856,7 @@ func renderDirectoryFiles(ctx *context.Context, timeout time.Duration) git.Entri ctx.Data["LatestCommitUser"] = user_model.ValidateCommitWithEmail(latestCommit) } - statuses, _, err := git_model.GetLatestCommitStatus(ctx, ctx.Repo.Repository.ID, ctx.Repo.Commit.ID.String(), db.ListOptions{}) + statuses, _, err := git_model.GetLatestCommitStatus(ctx, ctx.Repo.Repository.ID, latestCommit.ID.String(), db.ListOptions{}) if err != nil { log.Error("GetLatestCommitStatus: %v", err) }