Browse Source

Fix bug on commit graph (#15517)

pull/15162/merge
Lunny Xiao 3 weeks ago
committed by GitHub
parent
commit
a3c4c57b7c
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 4 deletions
  1. +5
    -4
      modules/gitgraph/graph_models.go

+ 5
- 4
modules/gitgraph/graph_models.go View File

@@ -7,6 +7,7 @@ package gitgraph
import (
"bytes"
"fmt"
"strings"

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/git"
@@ -216,10 +217,10 @@ func newRefsFromRefNames(refNames []byte) []git.Reference {
continue
}
refName := string(refNameBytes)
if refName[0:5] == "tag: " {
refName = refName[5:]
} else if refName[0:8] == "HEAD -> " {
refName = refName[8:]
if strings.HasPrefix(refName, "tag: ") {
refName = strings.TrimPrefix(refName, "tag: ")
} else if strings.HasPrefix(refName, "HEAD -> ") {
refName = strings.TrimPrefix(refName, "HEAD -> ")
}
refs = append(refs, git.Reference{
Name: refName,


Loading…
Cancel
Save