Java 类org.eclipse.jgit.lib.UserConfig 实例源码

项目:pdi-git-plugin    文件:UIGit.java   
@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();
  }
}
项目:gerrit    文件:GerritPersonIdentProvider.java   
@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();
}