aboutsummaryrefslogtreecommitdiffstats
path: root/bug/operation_pack.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-01-20 15:41:27 +0100
committerMichael Muré <batolettre@gmail.com>2019-03-01 22:40:22 +0100
commit14b240af8fef269d2c1d5dde2fff192b656c50f3 (patch)
tree4f6ea032789d811cd019bbb6c190c99a650084b2 /bug/operation_pack.go
parentd10c76469d40f13e27739fd363145e89bf74c3e0 (diff)
downloadgit-bug-14b240af8fef269d2c1d5dde2fff192b656c50f3.tar.gz
identity: more cleaning and fixes after a code review
Diffstat (limited to 'bug/operation_pack.go')
-rw-r--r--bug/operation_pack.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/bug/operation_pack.go b/bug/operation_pack.go
index 18b2a478..1ffc1d1a 100644
--- a/bug/operation_pack.go
+++ b/bug/operation_pack.go
@@ -139,6 +139,12 @@ func (opp *OperationPack) Validate() error {
// Write will serialize and store the OperationPack as a git blob and return
// its hash
func (opp *OperationPack) Write(repo repository.Repo) (git.Hash, error) {
+ // make sure we don't write invalid data
+ err := opp.Validate()
+ if err != nil {
+ return "", errors.Wrap(err, "validation error")
+ }
+
// First, make sure that all the identities are properly Commit as well
for _, op := range opp.Operations {
err := op.base().Author.Commit(repo)