Skip to content

Commit bc8544f

Browse files
Merge pull request #381 from dray92/debo/author_email
commit summary fails on 'author_email' being NULL
2 parents 316c406 + 6e04d1b commit bc8544f

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

cmd/summarize/commits/commits.go

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,14 +60,14 @@ SELECT
6060
`
6161

6262
type CommitAuthorSummary struct {
63-
AuthorName string `db:"author_name"`
64-
AuthorEmail string `db:"author_email"`
65-
Commits int `db:"commit_count"`
66-
Additions sql.NullInt64 `db:"additions"`
67-
Deletions sql.NullInt64 `db:"deletions"`
68-
DistinctFiles int `db:"distinct_files"`
69-
FirstCommit string `db:"first_commit"`
70-
LastCommit string `db:"last_commit"`
63+
AuthorName string `db:"author_name"`
64+
AuthorEmail sql.NullString `db:"author_email"`
65+
Commits int `db:"commit_count"`
66+
Additions sql.NullInt64 `db:"additions"`
67+
Deletions sql.NullInt64 `db:"deletions"`
68+
DistinctFiles int `db:"distinct_files"`
69+
FirstCommit string `db:"first_commit"`
70+
LastCommit string `db:"last_commit"`
7171
}
7272

7373
const commitAuthorSummarySQL = `
@@ -188,6 +188,7 @@ func (t *TermUI) loadCommitSummary() tea.Msg {
188188
}
189189

190190
var commitSummary CommitSummary
191+
191192
if err := t.db.QueryRowx(commitSummarySQL, sql.Named("file_path", pathPattern)).StructScan(&commitSummary); err != nil {
192193
return err
193194
}

0 commit comments

Comments
 (0)