o
    ~j6h)                     @  sF   d Z ddlmZ ddlZddlm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)Pathdirr   returnboolc                 C  s   |  d S )z3Is the given directory version-controlled with git?z.git)joinpathexistsr    r
   f/var/www/html/chefvision.cloud.itp360.com/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   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   )r   r   r   r   )r   r   )r   r   r   r   )	__doc__
__future__r   r   pathlibr   r   r   r   r
   r
   r
   r   <module>   s    

