diff options
author | Michael Muré <batolettre@gmail.com> | 2019-04-11 20:04:44 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-04-11 20:04:44 +0200 |
commit | 5eeeae7cdf24083277076041c4e8cdc6b4737fda (patch) | |
tree | 0e1e8b6a44650a146a296b3710757c309d420617 /commands/ls.go | |
parent | 4fac4abbcd357b9a8a99222af15a7c5fca9f5633 (diff) | |
download | git-bug-5eeeae7cdf24083277076041c4e8cdc6b4737fda.tar.gz |
commands: fix ls not displaying the new Identities properly
Diffstat (limited to 'commands/ls.go')
-rw-r--r-- | commands/ls.go | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/commands/ls.go b/commands/ls.go index ca74cc46..22940f2f 100644 --- a/commands/ls.go +++ b/commands/ls.go @@ -52,9 +52,21 @@ func runLsBug(cmd *cobra.Command, args []string) error { return err } + var name string + if b.AuthorId != "" { + author, err := backend.ResolveIdentityExcerpt(b.AuthorId) + if err != nil { + name = "<missing author data>" + } else { + name = author.DisplayName() + } + } else { + name = b.LegacyAuthor.DisplayName() + } + // truncate + pad if needed titleFmt := fmt.Sprintf("%-50.50s", b.Title) - authorFmt := fmt.Sprintf("%-15.15s", b.LegacyAuthor.Name) + authorFmt := fmt.Sprintf("%-15.15s", name) fmt.Printf("%s %s\t%s\t%s\tC:%d L:%d\n", colors.Cyan(b.HumanId()), |