o
    í6Wj)  ã                   @  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/home/esfera/Documents/content_generation/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    

