For Azure Git it can return tree
when referencing collections of items like files, tags, etc. There is no parameter to filter out these as Git doesn't actually understand folders, it is completely file based. Hence you cannot have an empty folder.
To "filter out" trees you need to post process the JSON and remove any item that has a gitObjectType
of tree
. Note that it might return other types as well so alternatively you could simply look for blob
types instead. Refer to the documentation on the object type for more information. Here's a link to a non-Azure DevOps overview of some of these object types.