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

Use codespell to fix typos in code, comments and man pages. Signed-off-by: Robin Jarry <robin@jarry.cc> Reviewed-by: Bence Ferdinandy <bence@ferdinandy.com> Acked-by: inwit <inwit@sindominio.net>
34 lines
682 B
Go
34 lines
682 B
Go
package pama
|
|
|
|
import (
|
|
"git.sr.ht/~rjarry/aerc/lib/pama/models"
|
|
)
|
|
|
|
// Init creates a new revision control project
|
|
func (m PatchManager) Init(name, path string, overwrite bool) error {
|
|
id, root, err := m.detect(path)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
rc, err := m.rc(id, root)
|
|
if err != nil {
|
|
return err
|
|
}
|
|
headID, err := rc.Head()
|
|
if err != nil {
|
|
return err
|
|
}
|
|
p := models.Project{
|
|
Name: name,
|
|
Root: root,
|
|
RevctrlID: id,
|
|
Base: models.NewCommit(rc, headID, ""),
|
|
Commits: make([]models.Commit, 0),
|
|
}
|
|
store := m.store()
|
|
err = store.StoreProject(p, overwrite)
|
|
if err != nil {
|
|
return storeErr(err)
|
|
}
|
|
return storeErr(store.SetCurrent(name))
|
|
}
|