Skip to content
This repository was archived by the owner on Sep 18, 2024. It is now read-only.

Commit 7b85383

Browse files
committed
Add LastCommitSHA to GetDirInfos
1 parent 9f6ca8b commit 7b85383

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

modules/structs/repo_tree.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ type GitEntry struct {
1919
IsLfs bool `json:"is_lfs"`
2020
LfsRelativePath string `json:"lfs_relative_path"`
2121
DownloadUrl string `json:"download_url"`
22+
LastCommitSHA string `json:"last_commit_sha"`
2223
}
2324

2425
// GitTreeResponse returns a git tree

routers/api/v1/repo/tree.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,9 +88,10 @@ func getDirectoryEntries(ctx *context.APIContext, branch, path string) ([]struct
8888
Mode: c.Entry.Mode().String(),
8989
Type: c.Entry.Type(),
9090
Size: c.Entry.Size(),
91-
SHA: c.Commit.ID.String(),
91+
SHA: c.Entry.ID.String(),
9292
CommitMsg: c.Commit.CommitMessage,
9393
CommitterDate: c.Commit.Committer.When,
94+
LastCommitSHA: c.Commit.ID.String(),
9495
}
9596
e.URL = ctx.Repo.Repository.HTMLURL() + "/raw/branch/" + url.PathEscape(branch) + "/" + url.PathEscape(strings.TrimPrefix(e.Path, "/"))
9697
e.DownloadUrl = e.URL

0 commit comments

Comments
 (0)