mirror of
https://git.sr.ht/~rjarry/aerc
synced 2025-07-06 19:30:22 +02:00

Implement the :patch find command. Search and filter for a given commit by subject line in the current accout and current folder. Signed-off-by: Koni Marti <koni.marti@gmail.com> Acked-by: Robin Jarry <robin@jarry.cc>
19 lines
394 B
Go
19 lines
394 B
Go
package pama
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"git.sr.ht/~rjarry/aerc/lib/pama/models"
|
|
)
|
|
|
|
func (m PatchManager) Find(hash string, p models.Project) (models.Commit, error) {
|
|
var c models.Commit
|
|
rc, err := m.rc(p.RevctrlID, p.Root)
|
|
if err != nil {
|
|
return c, revErr(err)
|
|
}
|
|
if !rc.Exists(hash) {
|
|
return c, fmt.Errorf("no commit found for hash %s", hash)
|
|
}
|
|
return models.NewCommit(rc, hash, ""), nil
|
|
}
|