mirror of
https://github.com/go-gitea/git.git
synced 2026-07-01 20:34:42 -04:00
[PR #113] [MERGED] GetCommit() returns a ErrNotExist if short commit ID does not exists #117
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
📋 Pull Request Information
Original PR: https://github.com/go-gitea/git/pull/113
Author: @agrn
Created: 4/14/2018
Status: ✅ Merged
Merged: 2/2/2019
Merged by: @techknowlogick
Base:
master← Head:al/short-commit-error📝 Commits (2)
ceeb8f4GetCommit() returns a ErrNotExist if short commit ID does not existsd08a180GetCommit(): change the comparison for short commit messages📊 Changes
1 file changed (+3 additions, -0 deletions)
View changed files
📝
repo_commit.go(+3 -0)📄 Description
Currently, GetCommit() returns a generic error if a short commit ID
does not exists in a repository.
When a commit is not found by git-rev-parse, it returns an errors
which contains "fatal: ambiguous argument". GetCommit() now search if
the error contains this string, and, if it does, returns an
ErrNotExist.
The idea is to allow commits to be accessed from gitea with a short
commit ID. Without this change, it would return a 500 Internal Server
Error when a short ID does not exists in the repository.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.