]> source.dussan.org Git - gitea.git/commit
Do not assume all 40 char strings are SHA1s (#14624)
authorzeripath <art27@cantab.net>
Wed, 10 Feb 2021 07:37:25 +0000 (07:37 +0000)
committerGitHub <noreply@github.com>
Wed, 10 Feb 2021 07:37:25 +0000 (07:37 +0000)
commit0a23079485b8f40bc86f6869a202be8be2727cc6
tree1ba25df2ce01c77596374d2abd335ee3b26d9a01
parentf9abf94bd99b5b9c603037aaad4dd327b68263bd
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 <art27@cantab.net>
modules/git/repo_commit.go