Treat possible commit as partial hash as fallback.

Sometimes full commit hash is not known but there is a need in giving a link to it. This patch adds support for partial commit hashes in URLs, so that links like "http://foo.com/bar.git/commit/ea42cd12f9" work.