text: public DirCache call() throws GitAPIException,NoFilepatternException {if (filepatterns.isEmpty())throw new NoFilepatternException(JGitText.get().atLeastOnePatternIsRequired);checkCallable();DirCache dc = null;List<String> actuallyDeletedFiles = new ArrayList<>();try (TreeWalk tw = new TreeWalk(repo)) {dc = repo.lockDirCache();DirCacheBuilder builder = dc.builder();tw.reset(); tw.setRecursive(true);tw.setFilter(PathFilterGroup.createFromStrings(filepatterns));tw.addTree(new DirCacheBuildIterator(builder));while (tw.next()) {if (!cached) {final FileMode mode = tw.getFileMode(0);if (mode.getObjectType() == Constants.OBJ_BLOB) {String relativePath = tw.getPathString();final File path = new File(repo.getWorkTree(),relativePath);if (delete(path)) {actuallyDeletedFiles.add(relativePath);}}}}builder.commit();setCallable(false);} catch (IOException e) {throw new JGitInternalException(JGitText.get().exceptionCaughtDuringExecutionOfRmCommand, e);} finally {try {if (dc != null) {dc.unlock();}} finally {if (!actuallyDeletedFiles.isEmpty()) {repo.fireEvent(new WorkingTreeModifiedEvent(null,actuallyDeletedFiles));}}}return dc;}