diff options
-rw-r--r-- | commands/root.go | 2 | ||||
-rw-r--r-- | doc/man/git-bug.1 | 2 | ||||
-rw-r--r-- | doc/md/git-bug.md | 2 | ||||
-rw-r--r-- | go.mod | 2 | ||||
-rw-r--r-- | go.sum | 2 | ||||
-rw-r--r-- | identity/identity.go | 2 | ||||
-rw-r--r-- | identity/identity_test.go | 23 |
7 files changed, 25 insertions, 10 deletions
diff --git a/commands/root.go b/commands/root.go index 1a424d32..92d32a5a 100644 --- a/commands/root.go +++ b/commands/root.go @@ -25,7 +25,7 @@ var RootCmd = &cobra.Command{ git-bug use git objects to store the bug tracking separated from the files history. As bugs are regular git objects, they can be pushed and pulled from/to -the same git remote your are already using to collaborate with other peoples. +the same git remote you are already using to collaborate with other people. `, diff --git a/doc/man/git-bug.1 b/doc/man/git-bug.1 index 6dba279e..b9e5d758 100644 --- a/doc/man/git-bug.1 +++ b/doc/man/git-bug.1 @@ -19,7 +19,7 @@ git\-bug is a bug tracker embedded in git. .PP git\-bug use git objects to store the bug tracking separated from the files history. As bugs are regular git objects, they can be pushed and pulled from/to -the same git remote your are already using to collaborate with other peoples. +the same git remote you are already using to collaborate with other people. .SH OPTIONS diff --git a/doc/md/git-bug.md b/doc/md/git-bug.md index 5f57f838..5a736f34 100644 --- a/doc/md/git-bug.md +++ b/doc/md/git-bug.md @@ -8,7 +8,7 @@ git-bug is a bug tracker embedded in git. git-bug use git objects to store the bug tracking separated from the files history. As bugs are regular git objects, they can be pushed and pulled from/to -the same git remote your are already using to collaborate with other peoples. +the same git remote you are already using to collaborate with other people. @@ -12,7 +12,7 @@ require ( github.com/corpix/uarand v0.1.1 // indirect github.com/dustin/go-humanize v1.0.0 github.com/fatih/color v1.9.0 - github.com/go-errors/errors v1.0.1 + github.com/go-errors/errors v1.0.2 github.com/gorilla/mux v1.7.4 github.com/hashicorp/golang-lru v0.5.4 // indirect github.com/icrowley/fake v0.0.0-20180203215853-4178557ae428 @@ -62,6 +62,8 @@ github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeME github.com/go-chi/chi v3.3.2+incompatible/go.mod h1:eB3wogJHnLi3x/kFX2A+IbTBlXxmMeXJVKy9tTv1XzQ= github.com/go-errors/errors v1.0.1 h1:LUHzmkK3GUKUrL/1gfBUxAHzcev3apQlezX/+O7ma6w= github.com/go-errors/errors v1.0.1/go.mod h1:f4zRHt4oKfwPJE5k8C9vpYG+aDHdBFUsgrm6/TyX73Q= +github.com/go-errors/errors v1.0.2 h1:xMxH9j2fNg/L4hLn/4y3M0IUsn0M6Wbu/Uh9QlOfBh4= +github.com/go-errors/errors v1.0.2/go.mod h1:psDX2osz5VnTOnFWbDeWwS7yejl+uV3FEWEp4lssFEs= github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as= github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE= github.com/go-logfmt/logfmt v0.4.0/go.mod h1:3RMwSq7FuexP4Kalkev3ejPJsZTpXXBr9+V4qmtdjCk= diff --git a/identity/identity.go b/identity/identity.go index 6b71fa35..3da8c5a3 100644 --- a/identity/identity.go +++ b/identity/identity.go @@ -289,7 +289,7 @@ type Mutator struct { Keys []*Key } -// Mutate allow to create a new version of the Identity +// Mutate allow to create a new version of the Identity in one go func (i *Identity) Mutate(f func(orig Mutator) Mutator) { orig := Mutator{ Name: i.Name(), diff --git a/identity/identity_test.go b/identity/identity_test.go index ee6ccdf7..f9091294 100644 --- a/identity/identity_test.go +++ b/identity/identity_test.go @@ -79,11 +79,6 @@ func TestIdentityCommitLoad(t *testing.T) { // add more version - identity.Mutate(func(orig Mutator) Mutator { - - return orig - }) - identity.addVersionForTest(&Version{ time: 201, name: "René Descartes", @@ -113,6 +108,24 @@ func TestIdentityCommitLoad(t *testing.T) { assert.Equal(t, identity, loaded) } +func TestIdentityMutate(t *testing.T) { + identity := NewIdentity("René Descartes", "rene.descartes@example.com") + + assert.Len(t, identity.versions, 1) + + identity.Mutate(func(orig Mutator) Mutator { + orig.Email = "rene@descartes.fr" + orig.Name = "René" + orig.Login = "rene" + return orig + }) + + assert.Len(t, identity.versions, 2) + assert.Equal(t, identity.Email(), "rene@descartes.fr") + assert.Equal(t, identity.Name(), "René") + assert.Equal(t, identity.Login(), "rene") +} + func commitsAreSet(t *testing.T, identity *Identity) { for _, version := range identity.versions { assert.NotEmpty(t, version.commitHash) |