Viewing File: /opt/hc_python/lib/python3.12/site-packages/pydantic/_internal/__pycache__/_git.cpython-312.pyc

�

e��g��<�dZddlmZddlZddlZdd�Zdd�Zd	d�Zy)
zjGit utilities, adopted from mypy's git utilities (https://github.com/python/mypy/blob/master/mypy/git.py).�)�annotationsNc�|�tjjtjj|d��S)z3Is the given directory version-controlled with git?z.git)�os�path�exists�join��dirs �F/opt/hc_python/lib/python3.12/site-packages/pydantic/_internal/_git.py�is_git_repor	s$��
�7�7�>�>�"�'�'�,�,�s�F�3�4�4�c�z�	tjddg�y#tj$rYyt$rYywxYw)zCan we run the git executable?�gitz--helpTF)�
subprocess�check_output�CalledProcessError�OSError�r
r�have_gitrs@�������� 1�2����(�(�������s��:�:�:c�n�tjgd�|��jd�j�S)z.Get the SHA-1 of the HEAD of a git repository.)rz	rev-parsez--short�HEAD)�cwdzutf-8)rr�decode�stripr	s r�git_revisionrs,���"�"�#J�PS�T�[�[�\c�d�j�j�l�lr
)r
�str�return�bool)rr)r
rrr)�__doc__�
__future__rrrrrrrr
r�<module>r!s!��p�"�	��5�
�mr
Back to Directory File Manager