Inconsistent API results across projects for project_branches endpoint

The docs for the project_brances endpoint show results with a commit member. Some of the projects in our organization return commits and sha’s where others don’t.
expected:

    {
      "name": "main",
      "isMain": true,
      "type": "LONG",
      "status": {
        "qualityGateStatus": "OK",
        "bugs": 0,
        "vulnerabilities": 0,
        "codeSmells": 30
      },
      "analysisDate": "2025-04-03T22:03:10+0200",
      "commit": {
        "sha": "2619a97c0a0807f44955135d75c2bcc92998ce08",
        "author": {
             ...
        },
        "date": "2025-04-03T21:30:34+0200",
        "message": "Update README.md"
      },
      ...
    },

Many other projects omit the commit values entirely from their results:

    {
      "name": "main",
      "isMain": true,
      "type": "LONG",
      "status": {
        "qualityGateStatus": "OK",
        "bugs": 0,
        "vulnerabilities": 0,
        "codeSmells": 0
      },
      ...
    },

Is this a setting in the project that needs adjusted, or is there some other way to get all projects to return the commit information for branches?

Hi,

Are the branches with commits long-lived or short-lived? I suspect that’s the underlying difference here.

 
Ann

There are both short and long lived branches in both projects. No commits appear in some projects. It is all or nothing for the commit entry. Either all branches in a project have them or not.

Hi,

Right. I missed the "name": "main" in both of your examples.

This is going to be about the SCM metadata available to analysis. You should compare the checkouts for the two projects.

 
Ann