gitweb: Faster return from git_get_preceding_references if possible