@NotNull protected VirtualFile[] collectAffectedFiles(@NotNull Project project,@NotNull VirtualFile[] files){
  List<VirtualFile> affectedFiles=new ArrayList<VirtualFile>(files.length);
  ProjectLevelVcsManager projectLevelVcsManager=ProjectLevelVcsManager.getInstance(project);
  for (  VirtualFile file : files) {
    if (!file.isDirectory() && projectLevelVcsManager.getVcsFor(file) instanceof GitVcs) {
      affectedFiles.add(file);
    }
 else     if (file.isDirectory() && isRecursive()) {
      addChildren(project,affectedFiles,file);
    }
  }
  return VfsUtilCore.toVirtualFileArray(affectedFiles);
}

@ NotNull protected VirtualFile [ ] collectAffectedFiles ( @ NotNull Project project , @ NotNull VirtualFile [ ] files ) { List < VirtualFile > affectedFiles = new ArrayList < VirtualFile > ( files . length ) ; ProjectLevelVcsManager projectLevelVcsManager = ProjectLevelVcsManager . getInstance ( project ) ; for ( VirtualFile file : files ) { if ( ! file . isDirectory ( ) && projectLevelVcsManager . getVcsFor ( file ) instanceof GitVcs ) { affectedFiles . add ( file ) ; } else if ( file . isDirectory ( ) && isRecursive ( ) ) { addChildren ( project , affectedFiles , file ) ; } } return VfsUtilCore . toVirtualFileArray ( affectedFiles ) ; }
given a list of action - target files , returns all the files that should be subject to the action does not keep directories , but recursively adds directory contents
