aboutsummaryrefslogtreecommitdiffstats
path: root/modules/git
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2020-06-12 00:49:47 +0100
committerGitHub <noreply@github.com>2020-06-11 19:49:47 -0400
commit0973c036019c955172ebce99d58eede2e9ac55ca (patch)
tree7c49364bba0ebfb4eb8c4bb5194f643629b929bc /modules/git
parent6c2a59b50c2af367281492b6c6adc9061e57b0a9 (diff)
downloadgitea-0973c036019c955172ebce99d58eede2e9ac55ca.tar.gz
gitea-0973c036019c955172ebce99d58eede2e9ac55ca.zip
Handle more pathological branch and tag names (#11843)
* Handle more pathological branch and tag names Signed-off-by: Andrew Thornton <art27@cantab.net> * Fix failing test Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: techknowlogick <techknowlogick@gitea.io>
Diffstat (limited to 'modules/git')
-rw-r--r--modules/git/repo_commit.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/git/repo_commit.go b/modules/git/repo_commit.go
index e282c9c674..479a0d0370 100644
--- a/modules/git/repo_commit.go
+++ b/modules/git/repo_commit.go
@@ -46,7 +46,7 @@ func (repo *Repository) GetBranchCommitID(name string) (string, error) {
// GetTagCommitID returns last commit ID string of given tag.
func (repo *Repository) GetTagCommitID(name string) (string, error) {
- stdout, err := NewCommand("rev-list", "-n", "1", name).RunInDir(repo.Path)
+ stdout, err := NewCommand("rev-list", "-n", "1", TagPrefix+name).RunInDir(repo.Path)
if err != nil {
if strings.Contains(err.Error(), "unknown revision or path") {
return "", ErrNotExist{name, ""}