@Test public void testComputeChangeScopeOfLocal() throws SourceControlException { Status status = mock(Status.class); when(status.hasUncommittedChanges()).thenReturn(true); when(status.getModified()).thenReturn(singleton("scm/src/main/java/com/sandboni/core/scm/resolvers/ChangeScopeResolver.java")); when(status.getChanged()).thenReturn(singleton("scm/src/main/java/com/sandboni/core/scm/resolvers/RevisionResolver.java")); when(status.getAdded()).thenReturn(singleton("scm/src/main/java/com/sandboni/core/scm/resolvers/BlameResolver.java")); mockStatic(PorcelainApi.class); when(PorcelainApi.call(any(), any())).thenReturn(status); RevisionScope<ObjectId> scope = revisionResolver.resolve(DiffConstants.LATEST_COMMIT, DiffConstants.LOCAL_CHANGES_NOT_COMMITTED); ChangeScope<Change> changeScope = jGitChangeScopeResolver.getChangeScope(scope); assertNotNull(changeScope); }
@Override public ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope) throws SourceControlException { final ChangeScope<Change> scope = new ChangeScopeImpl(); try { List<DiffEntry> filtered = getFilteredEntries(revisionScope); for (DiffEntry entry : filtered) { EditList editList = diffFormatter.toFileHeader(entry).toEditList(); if (!editList.isEmpty()) { computeDiffEntry(entry, editList, revisionScope, scope); } } } catch (IOException e) { throw new SourceControlException(ErrorMessages.SCAN_REVISIONS_EXCEPTION, e); } return scope; }
JGitChangeScopeResolver implements ChangeScopeResolver { @Override public ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope) throws SourceControlException { final ChangeScope<Change> scope = new ChangeScopeImpl(); try { List<DiffEntry> filtered = getFilteredEntries(revisionScope); for (DiffEntry entry : filtered) { EditList editList = diffFormatter.toFileHeader(entry).toEditList(); if (!editList.isEmpty()) { computeDiffEntry(entry, editList, revisionScope, scope); } } } catch (IOException e) { throw new SourceControlException(ErrorMessages.SCAN_REVISIONS_EXCEPTION, e); } return scope; } }
JGitChangeScopeResolver implements ChangeScopeResolver { @Override public ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope) throws SourceControlException { final ChangeScope<Change> scope = new ChangeScopeImpl(); try { List<DiffEntry> filtered = getFilteredEntries(revisionScope); for (DiffEntry entry : filtered) { EditList editList = diffFormatter.toFileHeader(entry).toEditList(); if (!editList.isEmpty()) { computeDiffEntry(entry, editList, revisionScope, scope); } } } catch (IOException e) { throw new SourceControlException(ErrorMessages.SCAN_REVISIONS_EXCEPTION, e); } return scope; } JGitChangeScopeResolver(Repository repository, SourceControlFilter... filters); }
JGitChangeScopeResolver implements ChangeScopeResolver { @Override public ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope) throws SourceControlException { final ChangeScope<Change> scope = new ChangeScopeImpl(); try { List<DiffEntry> filtered = getFilteredEntries(revisionScope); for (DiffEntry entry : filtered) { EditList editList = diffFormatter.toFileHeader(entry).toEditList(); if (!editList.isEmpty()) { computeDiffEntry(entry, editList, revisionScope, scope); } } } catch (IOException e) { throw new SourceControlException(ErrorMessages.SCAN_REVISIONS_EXCEPTION, e); } return scope; } JGitChangeScopeResolver(Repository repository, SourceControlFilter... filters); @Override ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope); }
JGitChangeScopeResolver implements ChangeScopeResolver { @Override public ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope) throws SourceControlException { final ChangeScope<Change> scope = new ChangeScopeImpl(); try { List<DiffEntry> filtered = getFilteredEntries(revisionScope); for (DiffEntry entry : filtered) { EditList editList = diffFormatter.toFileHeader(entry).toEditList(); if (!editList.isEmpty()) { computeDiffEntry(entry, editList, revisionScope, scope); } } } catch (IOException e) { throw new SourceControlException(ErrorMessages.SCAN_REVISIONS_EXCEPTION, e); } return scope; } JGitChangeScopeResolver(Repository repository, SourceControlFilter... filters); @Override ChangeScope<Change> getChangeScope(RevisionScope<ObjectId> revisionScope);  }