Debian Codegraph @

lib/pama/find.go

raw
1 package pama
2
3 import (
4 "fmt"
5
6 "git.sr.ht/~rjarry/aerc/lib/pama/models"
7 )
8
9 func (m PatchManager) Find(hash string, p models.Project) (models.Commit, error) {
10 var c models.Commit
11 rc, err := m.rc(p.RevctrlID, p.Root)
12 if err != nil {
13 return c, revErr(err)
14 }
15 if !rc.Exists(hash) {
16 return c, fmt.Errorf("no commit found for hash %s", hash)
17 }
18 return models.NewCommit(rc, hash, ""), nil
19 }