MCPcopy Index your code
hub / github.com/git-bug/git-bug / Validate

Method Validate

entity/dag/operation_pack.go:68–81  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66}
67
68func (opp *operationPack) Validate() error {
69 if opp.Author == nil {
70 return fmt.Errorf("missing author")
71 }
72 for _, op := range opp.Operations {
73 if op.Author().Id() != opp.Author.Id() {
74 return fmt.Errorf("operation has different author than the operationPack's")
75 }
76 }
77 if opp.EditTime == 0 {
78 return fmt.Errorf("lamport edit time is zero")
79 }
80 return nil
81}
82
83// Write writes the OperationPack in git, with zero, one or more parent commits.
84// If the repository has a key pair able to sign (that is, with a private key), the resulting commit is signed with that key.

Callers 1

WriteMethod · 0.95

Calls 3

ErrorfMethod · 0.80
IdMethod · 0.65
AuthorMethod · 0.65

Tested by

no test coverage detected