@Override public String getAuthorName( String commitId ) { if ( commitId.equals( IVCS.WORKINGTREE ) ) { Config config = git.getRepository().getConfig(); return config.get( UserConfig.KEY ).getAuthorName() + " <" + config.get( UserConfig.KEY ).getAuthorEmail() + ">"; } else { RevCommit commit = resolve( commitId ); PersonIdent author = commit.getAuthorIdent(); final StringBuilder r = new StringBuilder(); r.append( author.getName() ); r.append( " <" ); //$NON-NLS-1$ r.append( author.getEmailAddress() ); r.append( ">" ); //$NON-NLS-1$ return r.toString(); } }
@Inject public GerritPersonIdentProvider(@GerritServerConfig Config cfg) { String name = cfg.getString("user", null, "name"); if (name == null) { name = "Gerrit Code Review"; } this.name = name; email = cfg.get(UserConfig.KEY).getCommitterEmail(); }