Do not assume all 40 char strings are SHA1s (#14624)
Do not assume all 40 char strings are SHA1s (#14624)

GetCommit() assumes that all 40 char strings are SHA1s. This leads to an
error if you try to do a PR on a branch which is 40 characters long.

This PR attempts the SHA first - and if it fails will switch to using rev-parse.

Fix #14470

Signed-off-by: Andrew Thornton <6a547fdd28db89120bdd70d4af1f9ba672ccd43a@cantab.net>
vdbt/gitea,go-gitea/gitea,go-gitea/gitea,cez81/gitea,vdbt/gitea,cez81/gitea,go-gitea/gitea,cez81/gitea