Example #1
0
 def _check_repo_is_dirty(self):
     path = _get_main_file()
     if os.path.isfile(path):
         path = os.path.dirname(path)
     repo = git.Repo(path, search_parent_directories=True)
     if repo.is_dirty():
         raise RuntimeError("Git repository '{}' is dirty!".format(path))
Example #2
0
 def _check_repo_is_dirty(self):
     path = _get_main_file()
     if os.path.isfile(path):
         path = os.path.dirname(path)
     repo = git.Repo(path, search_parent_directories=True)
     if repo.is_dirty():
         error_message = "Git repository '{}' is dirty!".format(path)
         _logger.error(error_message)
         raise RuntimeError(error_message)
     else:
         _logger.info("Git repository '{}' is clean.".format(path))
Example #3
0
def _get_source_version():
    main_file = _get_main_file()
    if main_file is not None:
        return _get_git_commit(main_file)
    return None