diff options
author | Michael Muré <batolettre@gmail.com> | 2020-02-09 01:31:00 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-02-09 01:31:00 +0100 |
commit | 9e1a987b4d94dc5c2115423ede5954d4faf1d342 (patch) | |
tree | e30bb28d55444a7d1e66c8fa8b8ba7d413805473 /cache/bug_excerpt.go | |
parent | 97bc5ccd229b7b438262a84e3c42783b4d4a82af (diff) | |
parent | 9b1aaa032d36e1ac05504916e359f767d1622d9d (diff) | |
download | git-bug-9e1a987b4d94dc5c2115423ede5954d4faf1d342.tar.gz |
Merge pull request #294 from MichaelMure/cred-metadata
Cred metadata
Diffstat (limited to 'cache/bug_excerpt.go')
-rw-r--r-- | cache/bug_excerpt.go | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/cache/bug_excerpt.go b/cache/bug_excerpt.go index 36c7dcfe..10e522f9 100644 --- a/cache/bug_excerpt.go +++ b/cache/bug_excerpt.go @@ -2,7 +2,6 @@ package cache import ( "encoding/gob" - "fmt" "github.com/MichaelMure/git-bug/bug" "github.com/MichaelMure/git-bug/entity" @@ -43,21 +42,11 @@ type BugExcerpt struct { // identity.Bare data are directly embedded in the bug excerpt type LegacyAuthorExcerpt struct { - Name string - Login string + Name string } func (l LegacyAuthorExcerpt) DisplayName() string { - switch { - case l.Name == "" && l.Login != "": - return l.Login - case l.Name != "" && l.Login == "": - return l.Name - case l.Name != "" && l.Login != "": - return fmt.Sprintf("%s (%s)", l.Name, l.Login) - } - - panic("invalid person data") + return l.Name } func NewBugExcerpt(b bug.Interface, snap *bug.Snapshot) *BugExcerpt { @@ -95,8 +84,7 @@ func NewBugExcerpt(b bug.Interface, snap *bug.Snapshot) *BugExcerpt { e.AuthorId = snap.Author.Id() case *identity.Bare: e.LegacyAuthor = LegacyAuthorExcerpt{ - Login: snap.Author.Login(), - Name: snap.Author.Name(), + Name: snap.Author.Name(), } default: panic("unhandled identity type") |