You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix merge email confirmation when git config fails (#6797)
* Fix merge email confirmation when git config fails
Centralizes the preferred email logic for a `PullRequestModel` in the `FolderRepositoryManager`.
`PullRequestGitHelper.getEmail` can return an empty string when it is unable to find `user.email` in the local or global config. This can occur when the `user.email` config is set in a different scope (system, worktree) or its in an include file of the requested (local, global) scope (`git config` is not run with the `--includes` argument). Ideally there would be an API method to get config from _any_ scope, sadly this is not exposed on the `Repository` interface from the core git extension. If we are unable to get the email from git config, continue to default to the primary GitHub email and allow users to manually select the correct address to use.
Use this same default email logic in the Activity Bar View so that the merge buttons behave in a similar manner with regard to what email is used for merge commits.
See #6593, #6696
* Add globalState for last selected merge commit email
This state will be used when the email address from git config is unavailable or doesn't match any of the GitHub user's emails.
* Return from `saveLastUsedEmail`
---------
Co-authored-by: Alex Ross <38270282+alexr00@users.noreply.github.com>
0 commit comments