a
    _g                     @  sR   d Z ddlmZ ddlZddlZdddddZdd	d
dZdddddZdS )zjGit utilities, adopted from mypy's git utilities (https://github.com/python/mypy/blob/master/mypy/git.py).    )annotationsNstrbool)dirreturnc                 C  s   t jt j| dS )z3Is the given directory version-controlled with git?z.git)ospathexistsjoinr    r   e/var/www/html/cobodadashboardai.evdpl.com/venv/lib/python3.9/site-packages/pydantic/_internal/_git.pyis_git_repo	   s    r   )r   c                   C  sB   zt ddg W dS  t jy*   Y dS  ty<   Y dS 0 dS )zCan we run the git executable?gitz--helpTFN)
subprocesscheck_outputCalledProcessErrorOSErrorr   r   r   r   have_git   s    r   c                 C  s   t jg d| dd S )z.Get the SHA-1 of the HEAD of a git repository.)r   z	rev-parsez--shortHEAD)cwdzutf-8)r   r   decodestripr   r   r   r   git_revision   s    r   )__doc__
__future__r   r   r   r   r   r   r   r   r   r   <module>   s   