Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/flagutil/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ func (o *GitHubOptions) GitClientFactory(cookieFilePath string, cacheDir *string
return nil, fmt.Errorf("failed to get git authentication: %w", err)
}
opts.Username = func() (string, error) { return user, nil }
opts.GitUser = func() (string, string, error) { return user, "", nil } // pass empty email, git allows this
opts.Token = generator
}
// If the client is for Gerrit we're already set with the cookie filepath.
Expand Down
3 changes: 3 additions & 0 deletions pkg/git/v2/publisher.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,9 @@ type publisher struct {
// Commit adds all of the current content to the index and creates a commit
func (p *publisher) Commit(title, body string) error {
p.logger.Infof("Committing changes with title %q", title)
if p.info == nil {
return fmt.Errorf("error committing %q: GitUser is not set", title)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Current the returned error doesn't explain the remedy for developers.

}
name, email, err := p.info()
if err != nil {
return err
Expand Down