APISonar


org.eclipse.jgit.api.Git.log

> org > eclipse > jgit > api > Git > log
org APIs eclipse APIs jgit APIs api APIs Git APIs log APIs

Example 1
private Git git;

    protected void doLog(Exchange exchange, String operation) throws Exception {
        Iterable<RevCommit> revCommit = null;
        try {
            if (ObjectHelper.isNotEmpty(endpoint.getBranchName())) {
                git.checkout().setCreateBranch(false).setName(endpoint.getBranchName()).call();
            }
            revCommit = git.log().call();
        } catch (Exception e) {
            LOG.error("There was an error in Git " + operation + " operation");
            throw e;
        }
        updateExchange(exchange, revCommit);
    }
Example 2
protected void validateGitLogs(Git git, String... messages) throws GitAPIException {
        Iterable<RevCommit> logs = git.log().call();
        int count = 0;
        for (RevCommit rev : logs) {
            assertEquals(messages[count], rev.getShortMessage());
            count++;
        }
        assertEquals(messages.length, count);
    }
Example 3
public static Iterable<RevCommit> getGitLog(boolean privateRepository, String path) throws IOException, GitAPIException {
        Git git = privateRepository ? getPrivateGit() : getPublicGit();
        LogCommand lc = git.log();
        if (path != null) lc.addPath(path);
        return lc.call();
    }