@staticmethod
    def restore_shed_gitignore(statuszlines):
        """
        If a force reload of the RTC workspace sheds .gitignore files away, we need to restore them.
        In this case they are marked as deletions from git.

        :param statuszlines: the git status z output lines
        """
        gitignore = ".gitignore"
        gitignorelen = len(gitignore)
        deletedfiles = Commiter.splitoutputofgitstatusz(statuszlines, " D ")
        for deletedfile in deletedfiles:
            if deletedfile[-gitignorelen:] == gitignore:
                # only restore .gitignore if sibling .jazzignore still exists
                jazzignorefile = deletedfile[:-gitignorelen] + ".jazzignore"
                if os.path.exists(jazzignorefile):
                    shell.execute("git checkout -- %s" % deletedfile)
dataset/ETHPy150Open rtcTo/rtc2git/gitFunctions.py/Commiter.restore_shed_gitignore/original