fix(api): commit tree SHA is the commit ID (#39449)

Fixes #39448
This commit is contained in:
Max Azatian
2026-09-29 13:56:51 +02:00
committed by GitHub
parent 6bb74ed65d
commit ebcb0150d1
4 changed files with 23 additions and 2 deletions
+1
View File
@@ -66,6 +66,7 @@ func convertPGPSignature(c *object.Commit) *CommitSignature {
func convertCommit(c *object.Commit) *Commit {
return &Commit{
ID: ParseGogitHash(c.Hash),
TreeID: ParseGogitHash(c.TreeHash),
CommitMessage: CommitMessage{MessageRaw: c.Message},
Committer: &c.Committer,
Author: &c.Author,
+1
View File
@@ -37,6 +37,7 @@ func TestGetNoteNestedWithCache(t *testing.T) {
assert.Equal(t, "Note 1", note.BlobMessage.MessageUTF8())
assert.Equal(t, "ba0a96fa63532d6c5087ecef070b0250ed72fa47", note.TreePath)
assert.Equal(t, "Filip Navara", lastCommit.Author.Name)
assert.Equal(t, "fec9fe57e9864fe537f02f825e377c4a8a65ad2e", lastCommit.TreeID.String())
note, lastCommit, err = GetNoteWithLastCommit(t.Context(), repo, "3e668dbfac39cbc80a9ff9c61eb565d944453ba4")
assert.NoError(t, err)