Skip to content

Commit

Permalink
Merge pull request #381 from dray92/debo/author_email
Browse files Browse the repository at this point in the history
commit summary fails on 'author_email' being NULL
  • Loading branch information
patrickdevivo authored May 15, 2023
2 parents 316c406 + 6e04d1b commit bc8544f
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions cmd/summarize/commits/commits.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,14 @@ SELECT
`

type CommitAuthorSummary struct {
AuthorName string `db:"author_name"`
AuthorEmail string `db:"author_email"`
Commits int `db:"commit_count"`
Additions sql.NullInt64 `db:"additions"`
Deletions sql.NullInt64 `db:"deletions"`
DistinctFiles int `db:"distinct_files"`
FirstCommit string `db:"first_commit"`
LastCommit string `db:"last_commit"`
AuthorName string `db:"author_name"`
AuthorEmail sql.NullString `db:"author_email"`
Commits int `db:"commit_count"`
Additions sql.NullInt64 `db:"additions"`
Deletions sql.NullInt64 `db:"deletions"`
DistinctFiles int `db:"distinct_files"`
FirstCommit string `db:"first_commit"`
LastCommit string `db:"last_commit"`
}

const commitAuthorSummarySQL = `
Expand Down Expand Up @@ -188,6 +188,7 @@ func (t *TermUI) loadCommitSummary() tea.Msg {
}

var commitSummary CommitSummary

if err := t.db.QueryRowx(commitSummarySQL, sql.Named("file_path", pathPattern)).StructScan(&commitSummary); err != nil {
return err
}
Expand Down

0 comments on commit bc8544f

Please sign in to comment.