@Test public void testComputeChangeScopeFromGitDiffOutput_deletedFile() throws SourceControlException { mockStatic(GitDiffRunner.class); Diff diff = getChangeScopeDeletedFile(); when(GitDiffRunner.diff(any(), any())).thenReturn(singletonList(diff)); RevisionScope<ObjectId> scope = revisionResolver.resolve("fc776fe5e50", "e6f7c3d2954d6"); ChangeScope<Change> changeScope = changeScopeResolver.getChangeScope(scope); assertNotNull(changeScope); assertTrue(changeScope.getAllAffectedClasses().isEmpty()); }
@Override public ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope) throws SourceControlException { final ChangeScope<Change> scope = new ChangeScopeImpl(); List<Diff> diffs = GitDiffRunner.diff(repository, revisionScope); ObjectId toRevision = revisionScope.getTo(); diffs.forEach(throwingConsumerWrapper(d -> getChangesForDiff(d, scope, toRevision))); return scope; }
CliChangeScopeResolver extends JGitChangeScopeResolver implements ChangeScopeResolver { @Override public ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope) throws SourceControlException { final ChangeScope<Change> scope = new ChangeScopeImpl(); List<Diff> diffs = GitDiffRunner.diff(repository, revisionScope); ObjectId toRevision = revisionScope.getTo(); diffs.forEach(throwingConsumerWrapper(d -> getChangesForDiff(d, scope, toRevision))); return scope; } }
CliChangeScopeResolver extends JGitChangeScopeResolver implements ChangeScopeResolver { @Override public ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope) throws SourceControlException { final ChangeScope<Change> scope = new ChangeScopeImpl(); List<Diff> diffs = GitDiffRunner.diff(repository, revisionScope); ObjectId toRevision = revisionScope.getTo(); diffs.forEach(throwingConsumerWrapper(d -> getChangesForDiff(d, scope, toRevision))); return scope; } CliChangeScopeResolver(Repository repository, SourceControlFilter... filters); }
CliChangeScopeResolver extends JGitChangeScopeResolver implements ChangeScopeResolver { @Override public ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope) throws SourceControlException { final ChangeScope<Change> scope = new ChangeScopeImpl(); List<Diff> diffs = GitDiffRunner.diff(repository, revisionScope); ObjectId toRevision = revisionScope.getTo(); diffs.forEach(throwingConsumerWrapper(d -> getChangesForDiff(d, scope, toRevision))); return scope; } CliChangeScopeResolver(Repository repository, SourceControlFilter... filters); @Override ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope); }
CliChangeScopeResolver extends JGitChangeScopeResolver implements ChangeScopeResolver { @Override public ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope) throws SourceControlException { final ChangeScope<Change> scope = new ChangeScopeImpl(); List<Diff> diffs = GitDiffRunner.diff(repository, revisionScope); ObjectId toRevision = revisionScope.getTo(); diffs.forEach(throwingConsumerWrapper(d -> getChangesForDiff(d, scope, toRevision))); return scope; } CliChangeScopeResolver(Repository repository, SourceControlFilter... filters); @Override ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope);  }