1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 10:18:38 +00:00

Support getting last commit message using contents-ext API (#34904)

Fix #34870
Fix #34929

---------

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
RickyMa
2025-07-03 09:45:42 +08:00
committed by GitHub
parent 97fc87af89
commit 6455c8202b
11 changed files with 141 additions and 150 deletions

View File

@@ -18,6 +18,7 @@ import (
"code.gitea.io/gitea/modules/gitrepo"
"code.gitea.io/gitea/modules/setting"
api "code.gitea.io/gitea/modules/structs"
"code.gitea.io/gitea/modules/util"
"code.gitea.io/gitea/services/context"
"github.com/stretchr/testify/assert"
@@ -60,9 +61,9 @@ func getExpectedFileResponseForUpdate(info apiFileResponseInfo) *api.FileRespons
Name: path.Base(info.treePath),
Path: info.treePath,
SHA: sha,
LastCommitSHA: info.lastCommitSHA,
LastCommitterDate: info.lastCommitterWhen,
LastAuthorDate: info.lastAuthorWhen,
LastCommitSHA: util.ToPointer(info.lastCommitSHA),
LastCommitterDate: util.ToPointer(info.lastCommitterWhen),
LastAuthorDate: util.ToPointer(info.lastAuthorWhen),
Type: "file",
Size: 20,
Encoding: &encoding,