def _commit(self, repo, d):
        """
        Creates a new commit in the repository

        Where ``repo`` is a ``git.Repo`` object to create the commit in. And
        ``d`` is the directory you want the new commit to look like once the
        commit has been made.
        """
        # List files currently in our repository
        paths_current = set(self._flattendirectory(
            repo.working_dir, strip=self.target))

        # What needs to be added
        paths_new = set(self._flattendirectory(
            d, strip=d))

        paths_to_add = paths_current - paths_new
        paths_to_del = paths_current - paths_new
        paths_same = paths_new.intersection(paths_current)

        # Add
        for path in paths_to_add.union(paths_same):
            # Create the directory if needed
            directory = join(self.target, dirname(path))
            if not isdir(directory):
                makedirs(directory)

            copy2(
                join(d, path),
                join(self.target, path))

            repo.index.add([path])

        # Delete
        for path in paths_to_del:
            repo.index.remove([join(self.target, path)])

            unlink(join(self.target, path))

        repo.index.commit('Commit from numbered directory {0}'.format(d))
dataset/ETHPy150Open robmadole/jig/src/jig/tools.py/NumberedDirectoriesToGit._commit/swapped operands of `-`