관리-도구
편집 파일: git.cpython-38.pyc
U ,�e=! � @ s� d dl mZ d dlZd dlZd dlZd dlmZ d dlm Z d dl mZ d dl mZ d dl m Z e�e�ZdZd d d�dd �ZdIddd�dd�Zd d�dd�ZdJd d d�dd�ZdKd d d�dd�Zdd�dd�Zdd d �d!d"�Zd#d�d$d%�ZdLd&d d'�d(d)�Zd d�d*d+�Zd d�d,d-�Zd d d d.�d/d0�Zd d d1�d2d3�Zdd4�d d dd5�d6d7�Zdd�d8d9�Z d d d:d;�d<d=�Z!dMd d:d>�d?d@�Z"dNd d d dA�dBdC�Z#d:d�dDdE�Z$d d d dF�dGdH�Z%dS )O� )�annotationsN)�Mapping)� FatalError)�CalledProcessError)� cmd_output��cmd_output_b)z-czcore.useBuiltinFSMonitor=false�strz list[str])�s�returnc C s | � d�} | r| �d�S g S d S )N� )�strip�split)r � r �</opt/hc_python/lib/python3.8/site-packages/pre_commit/git.py�zsplit s r zMapping[str, str] | Nonezdict[str, str])�_envr c C s$ | d k r| nt j} dd� | �� D �S )Nc S s2 i | ]*\}}|� d �r(|� d�s(|dkr||�qS )ZGIT_)ZGIT_CONFIG_KEY_ZGIT_CONFIG_VALUE_> �GIT_SSH_COMMAND�GIT_HTTP_PROXY_AUTHMETHOD�GIT_SSL_CAINFO�GIT_SSH�GIT_CONFIG_COUNT�GIT_ASKPASS�GIT_SSL_NO_VERIFY� GIT_EXEC_PATH�GIT_ALLOW_PROTOCOL)� startswith)�.0�k�vr r r � <dictcomp>% s � zno_git_env.<locals>.<dictcomp>)�os�environ�items)r r r r � no_git_env s �r$ )r c C sf z4t j�tddd�d �� �} tddd�d �� }W n tk rP td��Y nX |dkrbtd��| S ) N�git� rev-parsez--show-cdup� z--is-inside-git-dirzGgit failed. Is it installed, and are you in a Git repository directory?�falsezfgit toplevel unexpectedly empty! make sure you are not inside the `.git` directory of your repository.)r! �path�abspathr r r r )�rootZinside_git_dirr r r �get_root3 s( � ��� �r, �.)�git_rootr c C sL d}t dd|| d�\}}}|�� }||kr@tj�tj�| |��S td��d S )Nz --git-dirr% r&