@staticmethod
    def match(repositoryfiles, extensions):
        """
        Determine the repository files to ignore.
        These filenames are returned as a list of newline terminated lines,
        ready to be added to .gitignore with writelines()

        :param repositoryfiles: a list of (changed) files
        :param extensions the extensions to be ignored
        :return: a list of newline terminated file names, possibly empty
        """
        repositoryfilestoignore = []
        for extension in extensions:
          for repositoryfile in repositoryfiles:
                extlen = len(extension)
                if len(repositoryfile) >= extlen:
                    if repositoryfile[-extlen:] == extension:
                        # prepend a forward slash (for non recursive,)
                        # escape a backslash with a backslash
                        # append a newline
                        repositoryfilestoignore.append('/' + repositoryfile.replace('\\', '\\\\') + os.linesep)
        return repositoryfilestoignore
dataset/ETHPy150Open rtcTo/rtc2git/gitFunctions.py/ExtensionFilter.match/original