Skip to content

commits api does not provide tree hash

Summary

The commits API, which gives information about a commit, omits a crucial detail: the tree hash of the commit.

Steps to reproduce

send a GET to an api commits endpoint. E.g.: https://gitlab.com/api/v4/projects/2752563/repository/commits/c65fb34347fc722dcc3874cafc1b5ca6628f2198

Example Project

Works in any project

What is the current bug behavior?

The tree hash is missing from the json output.

What is the expected correct behavior?

Expected: should include the git tree hash. In this case, b693a09d004675f506e2cd4e864fc78e9c582204 .

Output of checks

This bug happens on GitLab.com

Results of GitLab environment info

Possible fixes

include the tree hash.

For reference, here's the sample js output from github, which includes the tree hash: https://api.github.com/repos/phdru/ppu/git/commits/63c535d7c6b151c210e344dd4b745407f3911d76