관리-도구
편집 파일: _git.cpython-38.pyc
U /?�f � @ sR d Z ddlmZ ddlZddlZddd�dd�Zdd �d d�Zddd�dd �ZdS )zjGit utilities, adopted from mypy's git utilities (https://github.com/python/mypy/blob/master/mypy/git.py).� )�annotationsN�str�bool)�dir�returnc C s t j�t j�| d��S )z3Is the given directory version-controlled with git?z.git)�os�path�exists�join�r � r �E/opt/hc_python/lib/python3.8/site-packages/pydantic/_internal/_git.py�is_git_repo s r )r c C sF zt �ddg� W dS t jk r, Y dS tk r@ Y dS X dS )zCan we run the git executable?�gitz--helpTFN)� subprocess�check_output�CalledProcessError�OSErrorr r r r �have_git s r c C s t jddddg| d��d��� S )z.Get the SHA-1 of the HEAD of a git repository.r z rev-parsez--short�HEAD)�cwdzutf-8)r r �decode�stripr r r r �git_revision s r )�__doc__� __future__r r r r r r r r r r �<module> s