<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _needs_git(func):
 """ Small decorator to make sure we have the git repo, or report error otherwise. """


    @wraps(func)
    def myfunc(*args, **kwargs):
        if not WITH_GIT:
            raise RuntimeError(
                "Dulwich library not available, can't extract info from the "
                "git repos."
            )
        return func(*args, **kwargs)

    return myfunc