Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion modules/git/notes_nogogit.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ package git

import (
"io/ioutil"
"strings"
)

// GetNote retrieves the git-notes data for a given commit.
Expand Down Expand Up @@ -49,7 +50,13 @@ func GetNote(repo *Repository, commitID string, note *Note) error {
}
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 {
return err
}
Expand Down