lookup_commit function

Lookup the commit related to a git object