Add checking for rev and mirror/bare args in git.latest, Fix #9107

Fixes #9107