question: @ 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 ) ; }
target:  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