
    bMh)                    B    d Z ddlmZ ddlZddlmZ dd	Zdd
Z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                P    |                      d                                          S )z3Is the given directory version-controlled with git?z.git)joinpathexistsr   s    W/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/pydantic/_internal/_git.pyis_git_repor   	   s     <<&&(((    c                 x    	 t          j        ddg           dS # t           j        $ r Y dS t          $ r Y dS w xY w)zCan we run the git executable?gitz--helpTF)
subprocesscheck_outputCalledProcessErrorOSError r   r   have_gitr      s`     1222t(   uu   uus    9	99strc                |    t          j        g 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   s    r   git_revisionr      s;    "#J#J#JPSTTT[[\cddjjlllr   )r   r   r   r   )r   r   )r   r   r   r   )	__doc__
__future__r   r   pathlibr   r   r   r   r   r   r   <module>r!      s    p p " " " " " "          ) ) ) )
   m m m m m mr   