
    h$                    B    S r SSKJr  SSKrSSKrSS jrSS jrS	S jrg)
zjGit utilities, adopted from mypy's git utilities (https://github.com/python/mypy/blob/master/mypy/git.py).    )annotationsNc                |    [         R                  R                  [         R                  R                  U S5      5      $ )z3Is the given directory version-controlled with git?z.git)ospathexistsjoindirs    I/var/www/html/env/lib/python3.13/site-packages/pydantic/_internal/_git.pyis_git_repor   	   s$    77>>"'',,sF344    c                      [         R                  " SS/5        g! [         R                   a     g[         a     gf = f)zCan we run the git executable?gitz--helpTF)
subprocesscheck_outputCalledProcessErrorOSError r   r   have_gitr      s@     12((  s    =	==c                j    [         R                  " / SQU S9R                  S5      R                  5       $ )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,    ""#JPST[[\cdjjllr   )r
   strreturnbool)r   r   )r
   r   r   r   )__doc__
__future__r   r   r   r   r   r   r   r   r   <module>r!      s!    p " 	 5
mr   