diff options
-rw-r--r-- | README.md | 9 | ||||
-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-- | identity/identity.go | 2 | ||||
-rw-r--r-- | identity/identity_test.go | 23 | ||||
-rw-r--r-- | termui/bug_table.go | 4 |
7 files changed, 35 insertions, 9 deletions
@@ -47,6 +47,15 @@ That's all ! </details> +<details><summary>macOS packages</summary> + +* [Homebrew](https://formulae.brew.sh/formula/git-bug) + ``` + brew install git-bug + ``` + +</details> + <details><summary>Compile from git (unstable)</summary> ```shell 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. 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) diff --git a/termui/bug_table.go b/termui/bug_table.go index 80d5ebcb..2913ac80 100644 --- a/termui/bug_table.go +++ b/termui/bug_table.go @@ -437,6 +437,10 @@ func (bt *bugTable) newBug(g *gocui.Gui, v *gocui.View) error { } func (bt *bugTable) openBug(g *gocui.Gui, v *gocui.View) error { + if len(bt.excerpts) == 0 { + // There are no open bugs, just do nothing + return nil + } id := bt.excerpts[bt.selectCursor].Id b, err := bt.repo.ResolveBug(id) if err != nil { |