
    X-Ph                    F    d Z ddlmZ ddlZddlZddZdd	ZddZddZdS )zGit utilities.    )annotationsNdirstrreturnboolc                |    t           j                            t           j                            | d                    S )z3Is the given directory version-controlled with git?z.git)ospathexistsjoinr   s    H/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/mypy/git.pyis_git_repor   
   s&    7>>"',,sF33444    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bytesc                V    t          j        g d|                                           S )z.Get the SHA-1 of the HEAD of a git repository.)r   z	rev-parseHEADcwdr   r   stripr   s    r   git_revisionr       s+    "#?#?#?SIIIOOQQQr   c                b    t          j        g d|           }|                                dk    S )z7Check whether a git repository has uncommitted changes.)r   statusz-unoz--porcelainr   r   r   )r   outputs     r   is_dirtyr$      s2    $%M%M%MSVWWWF<<>>S  r   )r   r   r   r   )r   r   )r   r   r   r   )	__doc__
__future__r   r	   r   r   r   r    r$   r   r   r   <module>r'      s      # " " " " " 				    5 5 5 5
   R R R R
! ! ! ! ! !r   