import (
"bytes"
+ "crypto/sha1"
+ "fmt"
"io/ioutil"
"os"
"regexp"
)
var (
- sha1DigestRe = regexp.MustCompilePOSIX("([0-9a-f]{40,40})")
+ sha1DigestRe = regexp.MustCompilePOSIX(fmt.Sprintf("([0-9a-f]{%d,%d})", sha1.Size*2, sha1.Size*2))
repo *git.Repository
notesTree *object.Tree
+ commentsRef *plumbing.Reference
commentsTree *object.Tree
)
headHash := head.Hash()
if notes, err := repo.Notes(); err == nil {
var notesRef *plumbing.Reference
- var commentsRef *plumbing.Reference
notes.ForEach(func(ref *plumbing.Reference) error {
switch string(ref.Name()) {
case "refs/notes/commits":