o
    h$                     @  sB   d Z ddlmZ ddlZddlZddd	Zdd
dZ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dirstrreturnboolc                 C  s   t jt j| dS )z3Is the given directory version-controlled with git?z.git)ospathexistsjoinr    r   k/var/www/html/construction_image-detection-poc/venv/lib/python3.10/site-packages/pydantic/_internal/_git.pyis_git_repo	   s   r   c                   C  s>   z
t ddg W dS  t jy   Y dS  ty   Y dS w )zCan we run the git executable?gitz--helpTF)
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   )r   r   r   r   )r   r   )r   r   r   r   )__doc__
__future__r   r   r   r   r   r   r   r   r   r   <module>   s    

