a
    h)                     @  sV   d Z ddlmZ ddlZddlm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)Pathr   bool)dirreturnc                 C  s   |  d S )z3Is the given directory version-controlled with git?z.git)joinpathexistsr    r
   S/var/www/html/assistant/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   strc                 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   pathlibr   r   r   r   r
   r
   r
   r   <module>   s   