code: def check_repo_ok(self):
          
          from git import Repo, exc
          # Check that git is at the expected commit and that the repo is not
          # dirty
          if self.runner is not None:
              path = self.runner.path
              try:
                  repo = Repo(path)
              except(exc.InvalidGitRepositoryError):
                  raise Exception("No git repository detected.\nIn order to "
                                  "use SEM and its reproducibility enforcing "
                                  "features, please create a git repository at "
                                  "the root of your ns-3 project.")
              current_commit = repo.head.commit.hexsha
              campaign_commit = self.db.get_commit()
  
              if repo.is_dirty(untracked_files=True):
                  raise Exception("ns-3 repository is not clean")
  
              if current_commit != campaign_commit:
                  raise Exception("ns-3 repository is on a different commit "
                                  "from the one specified in the campaign")
docs: Make sure that the ns-3 repository's HEAD commit is the same as the one
          saved in the campaign database, and that the ns-3 repository is clean
          (i.e., no untracked or modified files exist).