@staticmethod
    def ignorejazzignore(repositoryfiles):
        """
        If a .jazzignore file is modified or added, translate it to .gitignore,
        if a .jazzignore file is deleted, delete the corresponding .gitignore file as well.

        :param repositoryfiles: the modified files
        """
        jazzignore = ".jazzignore"
        jazzignorelen = len(jazzignore)
        for repositoryfile in repositoryfiles:
            if repositoryfile[-jazzignorelen:] == jazzignore:
                path = repositoryfile[0:jazzignorelen-len(repositoryfile)]
                gitignore = path + ".gitignore"
                if os.path.exists(repositoryfile):
                    # update (or create) .gitignore
                    jazzignorelines = []
                    with open(repositoryfile, 'r') as jazzignorefile:
                        jazzignorelines = jazzignorefile.readlines()
                    if len(jazzignorelines) > 0:
                        # overwrite in any case
                        with open(gitignore, 'w') as gitignorefile:
                            gitignorefile.writelines(Commiter.translatejazzignore(jazzignorelines))
                else:
                    # delete .gitignore
                    if os.path.exists(gitignore):
                        os.remove(gitignore)
dataset/ETHPy150Open rtcTo/rtc2git/gitFunctions.py/Commiter.ignorejazzignore/swapped operands of `-`