def enforce_clean_option(args, run):
    """Fail if any version control repository is dirty."""
    repos = run.experiment_info["repositories"]
    if not repos:
        raise RuntimeError(
            "No version control detected. "
            "Cannot enforce clean repository.\n"
            "Make sure that your sources under VCS and the "
            "corresponding python package is installed."
        )
    else:
        for repo in repos:
            if repo["dirty"]:
                raise RuntimeError(
                    "EnforceClean: Uncommited changes in "
                    'the "{}" repository.'.format(repo)
                )
Fail if any version control repository is dirty.
sacred/commandline_options.py