Merge duplicate code and add a unit test There are already integration test cases in `TestEditor` -> `WebGitCommitEmail` for these two endpoints.