Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support shortened commit SHAs in URLs (go-gitea#6450)
This supports using a git SHA of any length between 7 and 40 characters in URLs (e.g. /src/commit/SHA/...). Previously only commit SHAs of the full 40 character length were supported. The RepoRefAny ref type is used in one place, in the /api/v1/user/repo/raw API endpoint where it is used to guess whether the remainder of the path is a ref name followed by a file path or merely a file path. There is no good way to guess whether a shortened SHA is intended in that circumstance (e.g., /raw/beefcafe/README.txt could be /README.txt in the beefcafe{..32} commit, or /beefcafe/README.txt on the master branch). For this case, we don't support shortened SHAs and only match on the full one. Signed-off-by: James E. Blair <jeblair@redhat.com>
- Loading branch information