1
1
mirror of https://github.com/go-gitea/gitea synced 2025-07-22 18:28:37 +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

@@ -116,14 +116,17 @@ type ContentsExtResponse struct {
// ContentsResponse contains information about a repo's entry's (dir, file, symlink, submodule) metadata and content
type ContentsResponse struct {
Name string `json:"name"`
Path string `json:"path"`
SHA string `json:"sha"`
LastCommitSHA string `json:"last_commit_sha"`
Name string `json:"name"`
Path string `json:"path"`
SHA string `json:"sha"`
LastCommitSHA *string `json:"last_commit_sha,omitempty"`
// swagger:strfmt date-time
LastCommitterDate time.Time `json:"last_committer_date"`
LastCommitterDate *time.Time `json:"last_committer_date,omitempty"`
// swagger:strfmt date-time
LastAuthorDate time.Time `json:"last_author_date"`
LastAuthorDate *time.Time `json:"last_author_date,omitempty"`
LastCommitMessage *string `json:"last_commit_message,omitempty"`
// `type` will be `file`, `dir`, `symlink`, or `submodule`
Type string `json:"type"`
Size int64 `json:"size"`
@@ -141,8 +144,8 @@ type ContentsResponse struct {
SubmoduleGitURL *string `json:"submodule_git_url"`
Links *FileLinksResponse `json:"_links"`
LfsOid *string `json:"lfs_oid"`
LfsSize *int64 `json:"lfs_size"`
LfsOid *string `json:"lfs_oid,omitempty"`
LfsSize *int64 `json:"lfs_size,omitempty"`
}
// FileCommitResponse contains information generated from a Git commit for a repo's file.