관리-도구
편집 파일: try_repo.cpython-38.pyc
U ,�e � @ s� d dl mZ d dlZd dlZd dlZd dlZd dlmZ d dl mZ d dl mZ d dl mZ d dlmZ d dlmZ d dlmZ d d lmZ d d lmZ e�e�Zdddd d�dd�Zddd�dd�ZdS )� )�annotationsN)�git)�output)� load_manifest)�run)�Store)�cmd_output_b)�xargs)� yaml_dump�strz str | Noneztuple[str, str])�tmpdir�repo�ref�returnc C s� |d k r||fS t �|�}tj�|�r�t jd|d�r�t�d� tj�| d�}t dd||� t dd|dd |d � t j d|d�}t j d|d�}ttj||d �}t j |d �}|r�td|||d� t ddd||d� t j|d� |t �|�fS ||fS d S )N�HEAD)r z3Creating temporary repo with uncommitted changes...zshadow-repor �clone�checkoutz-bZ_pc_tmp)�cwd�index�objects)ZGIT_INDEX_FILEZGIT_OBJECT_DIRECTORY)r �addz--)r �envr z-u)r Zhead_rev�os�path�existsZhas_diff�logger�warning�joinr Zgit_path�dict�environZget_staged_filesr �commit)r r r Zshadow�idxZobjsr Zstaged_files� r"