mirror of https://github.com/go-gitea/gitea.git
Backport #15561 Fix #15558 Signed-off-by: Andrew Thornton <art27@cantab.net>
This commit is contained in:
parent
990c6089db
commit
248b67af6f
|
@ -8,6 +8,7 @@ package git
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
// GetNote retrieves the git-notes data for a given commit.
|
// GetNote retrieves the git-notes data for a given commit.
|
||||||
|
@ -49,7 +50,13 @@ func GetNote(repo *Repository, commitID string, note *Note) error {
|
||||||
}
|
}
|
||||||
note.Message = d
|
note.Message = d
|
||||||
|
|
||||||
lastCommits, err := GetLastCommitForPaths(notes, "", []string{path})
|
treePath := ""
|
||||||
|
if idx := strings.LastIndex(path, "/"); idx > -1 {
|
||||||
|
treePath = path[:idx]
|
||||||
|
path = path[idx+1:]
|
||||||
|
}
|
||||||
|
|
||||||
|
lastCommits, err := GetLastCommitForPaths(notes, treePath, []string{path})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue