Skip to content

Commit

Permalink
Fix bug on commit graph (#15517)
Browse files Browse the repository at this point in the history
  • Loading branch information
lunny authored Apr 17, 2021
1 parent eee30d5 commit a3c4c57
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions modules/gitgraph/graph_models.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ package gitgraph
import (
"bytes"
"fmt"
"strings"

"code.gitea.io/gitea/models"
"code.gitea.io/gitea/modules/git"
Expand Down Expand Up @@ -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,
Expand Down

0 comments on commit a3c4c57

Please sign in to comment.