@Test public void testDiffWithSameToAndFrom() throws Exception { RevisionScope<ObjectId> scope = revisionResolver.resolve("60075ec4", "60075ec4"); PowerMockito.doNothing().when(GitDiffRunner.class, "addFileTypeFilters", Mockito.any()); List<Diff> diffs = GitDiffRunner.diff(repository, scope); assertNotNull(diffs); assertEquals(33, diffs.size()); }
public static List<Diff> diff(Repository repository, RevisionScope<ObjectId> revisionScope) throws SourceControlException { String[] command = buildDiffCommand(revisionScope); try { List<String> diffLines = ProcessRunner.runCommand(getRepositoryBaseFolder(repository), command); byte[] diffBytes = pad(diffLines); return new UnifiedDiffParser().parse(diffBytes); } catch (IOException e) { throw new SourceControlException("Error running git diff command", e); } }
GitDiffRunner { public static List<Diff> diff(Repository repository, RevisionScope<ObjectId> revisionScope) throws SourceControlException { String[] command = buildDiffCommand(revisionScope); try { List<String> diffLines = ProcessRunner.runCommand(getRepositoryBaseFolder(repository), command); byte[] diffBytes = pad(diffLines); return new UnifiedDiffParser().parse(diffBytes); } catch (IOException e) { throw new SourceControlException("Error running git diff command", e); } } }
GitDiffRunner { public static List<Diff> diff(Repository repository, RevisionScope<ObjectId> revisionScope) throws SourceControlException { String[] command = buildDiffCommand(revisionScope); try { List<String> diffLines = ProcessRunner.runCommand(getRepositoryBaseFolder(repository), command); byte[] diffBytes = pad(diffLines); return new UnifiedDiffParser().parse(diffBytes); } catch (IOException e) { throw new SourceControlException("Error running git diff command", e); } } private  GitDiffRunner(); }
GitDiffRunner { public static List<Diff> diff(Repository repository, RevisionScope<ObjectId> revisionScope) throws SourceControlException { String[] command = buildDiffCommand(revisionScope); try { List<String> diffLines = ProcessRunner.runCommand(getRepositoryBaseFolder(repository), command); byte[] diffBytes = pad(diffLines); return new UnifiedDiffParser().parse(diffBytes); } catch (IOException e) { throw new SourceControlException("Error running git diff command", e); } } private  GitDiffRunner(); static List<Diff> diff(Repository repository, RevisionScope<ObjectId> revisionScope); }
GitDiffRunner { public static List<Diff> diff(Repository repository, RevisionScope<ObjectId> revisionScope) throws SourceControlException { String[] command = buildDiffCommand(revisionScope); try { List<String> diffLines = ProcessRunner.runCommand(getRepositoryBaseFolder(repository), command); byte[] diffBytes = pad(diffLines); return new UnifiedDiffParser().parse(diffBytes); } catch (IOException e) { throw new SourceControlException("Error running git diff command", e); } } private  GitDiffRunner(); static List<Diff> diff(Repository repository, RevisionScope<ObjectId> revisionScope);  }