aboutsummaryrefslogtreecommitdiffstats
path: root/commands/ls.go
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2019-04-11 20:04:44 +0200
committerMichael Muré <batolettre@gmail.com>2019-04-11 20:04:44 +0200
commit5eeeae7cdf24083277076041c4e8cdc6b4737fda (patch)
tree0e1e8b6a44650a146a296b3710757c309d420617 /commands/ls.go
parent4fac4abbcd357b9a8a99222af15a7c5fca9f5633 (diff)
downloadgit-bug-5eeeae7cdf24083277076041c4e8cdc6b4737fda.tar.gz
commands: fix ls not displaying the new Identities properly
Diffstat (limited to 'commands/ls.go')
-rw-r--r--commands/ls.go14
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()),