WIP: Renders 404 in commits controller if no commits are found

What does this MR do?

Whenever we show commits and no commits are found a 404 is going to be rendered. The exception for that is when no path is requested and the format is atom.

Why was this MR needed?

@filipa opened #37620 reporting a white page is rendered when a wrong path is requested.

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #37620

Edited by username-removed-1616781