public CommitInfo getCommitInfo ( String path ) throws Exception { Iterator < RevCommit > revCommits = git . log ( ) . addPath ( path ) . setMaxCount ( 1 ) . call ( ) . iterator ( ) ; if ( revCommits . hasNext ( ) ) { RevCommit revCommit = revCommits . next ( ) ; CommitInfo commitInfo = new CommitInfo ( revCommit . getId ( ) . name ( ) ) ; PersonIdent committerIdent = revCommit . getCommitterIdent ( ) ; commitInfo . setCommitter ( committerIdent . getName ( ) ) ; commitInfo . setEmail ( committerIdent . getEmailAddress ( ) ) ; if ( ( commitInfo . getCommitter ( ) == null || commitInfo . getCommitter ( ) . isEmpty ( ) ) && commitInfo . getEmail ( ) != null ) commitInfo . setCommitter ( commitInfo . getEmail ( ) ) ; commitInfo . setDate ( committerIdent . getWhen ( ) ) ; commitInfo . setMessage ( revCommit . getShortMessage ( ) ) ; return commitInfo ; } return null ; }
Does not fetch .