Commit email is not respected for all actions
Summary
In https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/21598, we introduced the idea of a commit email. Git modifications via the web UI should use this email address, rather than the user's primary email, when generating commits, tags, and other git objects that store an email address.
However, not every site that creates a commit was correctly updated, as far as I can see.
Steps to reproduce
- Set up a commit email
- Create a new file in a repository
- Clone the repository and observe the output of
git log
What is the current bug behavior?
User#email
is still used in the commit
What is the expected correct behavior?
User#commit_email
should be used instead
Possible fixes
Modify https://gitlab.com/gitlab-org/gitlab-ce/blob/master/app/services/files/base_service.rb to use Gitlab::Git::User.from_gitlab
when determining the default user name and email.
There may be other sites as well.
Edited by Nick Thomas