Fix if the identifier provided is one of a blob instead of a commit
Currently if the user provide the hash of a blob instead of the one of a
commit, we simply crash since the objects are different.
With this commit, we will raise a 404 error instead of a 500 error.
Fixes an error reported by email
Signed-off-by: Pierre-Yves Chibon <pingou@pingoured.fr>