관리-도구
편집 파일: git.cpython-310.pyc
o ƚRe�E � @ s d dl Z d dlZd dlZd dlZd dlZd dlZd dlm Z m Z mZ d dlm Z mZ d dlmZmZmZ d dlmZ d dlmZmZmZmZmZmZmZ ejjZejjZe � e!�Z"e�#d�Z$e�#d�Z%e�#d ej&�Z'd e(de)fdd �Z*G dd� de�Z+e�,e+� dS )� N)�List�Optional�Tuple)� BadCommand�InstallationError)� HiddenText�display_path�hide_url)�make_command)�AuthInfo�RemoteNotFoundError�RemoteNotValidError� RevOptions�VersionControl�(find_path_to_project_root_from_repo_root�vcsz(^git version (\d+)\.(\d+)(?:\.(\d+))?.*$z^[a-fA-F0-9]{40}$a/ ^ # Optional user, e.g. 'git@' (\w+@)? # Server, e.g. 'github.com'. ([^/:]+): # The server-side path. e.g. 'user/project.git'. Must start with an # alphanumeric character so as not to be confusable with a Windows paths # like 'C:/foo/bar' or 'C:\foo\bar'. (\w[^:]*) $�sha�returnc C s t t�| ��S �N)�bool� HASH_REGEX�match)r � r ��/builddir/build/BUILDROOT/alt-python310-pip-21.3.1-3.el8.x86_64/opt/alt/python310/lib/python3.10/site-packages/pip/_internal/vcs/git.py�looks_like_hash7 s r c sD e Zd ZdZdZdZdZdZdZe de dee fd d ��Zde de de fd d�Zdeedf fdd�Zede dee fdd��Zede de deee e f fdd��Zede de de fdd��Zede dededefdd��Zede dee de fdd��Zde dededdfd d!�Zde dededdfd"d#�Zde dededdfd$d%�Zede de fd&d'��Ze de de fd(d)��Zede de de fd*d+��Z ed9de dee de fd,d-��Z!ede dee fd.d/��Z"ede dee ee e#f f� fd0d1��Z$ede ddfd2d3��Z%ede dee f� fd4d5��Z&e d6e de fd7d8��Z'� Z(S ):�Git�gitz.git�clone)zgit+httpz git+httpszgit+sshzgit+gitzgit+file)�GIT_DIR� GIT_WORK_TREE�HEAD�revr c C s | gS r r �r! r r r �get_base_rev_argsK s zGit.get_base_rev_args�url�destc C sJ | � t|��\}}|jsdS | �||j�sdS t| �||j�d �}| S )NFr )�get_url_rev_optionsr r! �is_commit_id_equalr �get_revision_sha)�selfr$ r% �_�rev_options�is_tag_or_branchr r r �is_immutable_rev_checkoutO s zGit.is_immutable_rev_checkout.c C sF | j dgddd�}t�|�}|st�d|� dS tdd� |�� D ��S ) N�versionFT)�show_stdout�stdout_onlyzCan't parse git version: %sr c s s � | ]}t |�V qd S r )�int)�.0�cr r r � <genexpr>c s � z&Git.get_git_version.<locals>.<genexpr>)�run_command�GIT_VERSION_REGEXr �logger�warning�tuple�groups)r) r. r r r r �get_git_version] s zGit.get_git_version�locationc C sB g d�}| j |ddd|d�}|�� }|�d�r|td�d� S dS )zl Return the current branch, or None if HEAD isn't at a branch (e.g. detached HEAD). )zsymbolic-ref�-qr �� FT��extra_ok_returncodesr/ r0 �cwdzrefs/heads/N)r5 �strip� startswith�len)�clsr<