@Test public void testGitLogCommitLimiting() throws IOException, JavaGitException { CliGitLog gitLog = new CliGitLog(); GitLogOptions options = new GitLogOptions(); options.setOptLimitCommitMax(true, 1); options.setOptFileDetails(true); List<Commit> log = gitLog.log(repoDirectory, options); if(log.size()==1){ return; } else{ fail("Failed Log size does not match, commit limiting failed"); } }
public List<Commit> log(File repositoryPath, GitLogOptions options, ScmLogEntryHandler<Commit> handler) throws JavaGitException, IOException { CheckUtilities.checkFileValidity(repositoryPath); GitLogParser parser = new GitLogParser(handler); List<String> command = buildCommand(repositoryPath, options); GitLogResponse response = (GitLogResponse) ProcessUtilities.runCommand(repositoryPath, command, parser); if (response.containsError()) { int line = response.getError(0).getLineNumber(); String error = response.getError(0).error(); throw new JavaGitException(420001, "Line " + line + ", " + error); } return response.getLog(); }
CliGitLog implements IGitLog { public List<Commit> log(File repositoryPath, GitLogOptions options, ScmLogEntryHandler<Commit> handler) throws JavaGitException, IOException { CheckUtilities.checkFileValidity(repositoryPath); GitLogParser parser = new GitLogParser(handler); List<String> command = buildCommand(repositoryPath, options); GitLogResponse response = (GitLogResponse) ProcessUtilities.runCommand(repositoryPath, command, parser); if (response.containsError()) { int line = response.getError(0).getLineNumber(); String error = response.getError(0).error(); throw new JavaGitException(420001, "Line " + line + ", " + error); } return response.getLog(); } }
CliGitLog implements IGitLog { public List<Commit> log(File repositoryPath, GitLogOptions options, ScmLogEntryHandler<Commit> handler) throws JavaGitException, IOException { CheckUtilities.checkFileValidity(repositoryPath); GitLogParser parser = new GitLogParser(handler); List<String> command = buildCommand(repositoryPath, options); GitLogResponse response = (GitLogResponse) ProcessUtilities.runCommand(repositoryPath, command, parser); if (response.containsError()) { int line = response.getError(0).getLineNumber(); String error = response.getError(0).error(); throw new JavaGitException(420001, "Line " + line + ", " + error); } return response.getLog(); }  }
CliGitLog implements IGitLog { public List<Commit> log(File repositoryPath, GitLogOptions options, ScmLogEntryHandler<Commit> handler) throws JavaGitException, IOException { CheckUtilities.checkFileValidity(repositoryPath); GitLogParser parser = new GitLogParser(handler); List<String> command = buildCommand(repositoryPath, options); GitLogResponse response = (GitLogResponse) ProcessUtilities.runCommand(repositoryPath, command, parser); if (response.containsError()) { int line = response.getError(0).getLineNumber(); String error = response.getError(0).error(); throw new JavaGitException(420001, "Line " + line + ", " + error); } return response.getLog(); }  List<Commit> log(File repositoryPath, GitLogOptions options, ScmLogEntryHandler<Commit> handler); List<Commit> log(File repositoryPath, GitLogOptions options); List<Commit> log(File repositoryPath); }
CliGitLog implements IGitLog { public List<Commit> log(File repositoryPath, GitLogOptions options, ScmLogEntryHandler<Commit> handler) throws JavaGitException, IOException { CheckUtilities.checkFileValidity(repositoryPath); GitLogParser parser = new GitLogParser(handler); List<String> command = buildCommand(repositoryPath, options); GitLogResponse response = (GitLogResponse) ProcessUtilities.runCommand(repositoryPath, command, parser); if (response.containsError()) { int line = response.getError(0).getLineNumber(); String error = response.getError(0).error(); throw new JavaGitException(420001, "Line " + line + ", " + error); } return response.getLog(); }  List<Commit> log(File repositoryPath, GitLogOptions options, ScmLogEntryHandler<Commit> handler); List<Commit> log(File repositoryPath, GitLogOptions options); List<Commit> log(File repositoryPath);  }