File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/__pycache__/git.cpython-310.pyc
o
�N�g�� � @ s@ d Z ddlZddlZddlZddlZddlZddlZddlZddl Zddl
ZddlZddlZddl
ZddlZddlZddlZddlZddlmZmZ ddlmZ e�e�ZddiZdd� Zd�d
d�Z d�d
d�Zdd� Zdd� Zdd� Z dd� Z!dd� Z" d�dd�Z#d�dd�Z$d�dd�Z%d�d d!�Z& " " d�d#d$�Z' % " d�d&d'�Z( " " d�d(d)�Z) " " d�d*d+�Z* " " d�d,d-�Z+ " " d�d.d/�Z, d�d0d1�Z- d�d2d3�Z.ej/j0�1e.d4�Z2 d�d5d6�Z3 d�d7d8�Z4 d�d9d:�Z5 % d�d;d<�Z6 " " d�d=d>�Z7 d�d@dA�Z8 " " d�dBdC�Z9 " " d�dDdE�Z:d�dFdG�Z; d�dHdI�Z< d�dJdK�Z= d�dLdM�Z> N " " d�dOdP�Z? " " d�dQdR�Z@ " " d�dSdT�ZA d�dUdV�ZB " " d�dWdX�ZC " " d�dYdZ�ZD [ " " d�d\d]�ZE N d�d^d_�ZF d�d`da�ZG N d�dbdc�ZH d�ddde�ZI " " d�dfdg�ZJ " " d�dhdi�ZK % d�djdk�ZL " " d�dld�ZM m " " d�dndo�ZNd�dpdq�ZO " " d�drds�ZP " " d�dtdu�ZQ % " " d�dvdw�ZRd�dxdy�ZS " " d�dzd{�ZT " " d�d|d}�ZUd�d~d�ZVdS )�z
Support for the Git SCM
� N)�CommandExecutionError�SaltInvocationError)�LooseVersion�rm_�rmc C s t jj�d�du rdS dS )z/
Only load if git exists on the system
�gitN)Fz;The git execution module cannot be loaded: git unavailable.T)�salt�utils�path�which� r r �D/opt/saltstack/salt/lib/python3.10/site-packages/salt/modules/git.py�__virtual__ s r Tc C s4 t dd�}t|�td�k r| rtd�|���dS dS )zJ
Ensure that we don't try to operate on worktrees in git < 2.5.0.
F��versioninfoz2.5.0zNWorktrees are only supported in git 2.5.0 and newer (detected git version: {})T)�versionr r �format)�failhard�git_versionr r r
�_check_worktree_support( s
�r Fc K s� t jjjd
i |��}|�dd�} |rt jj�|� |du r$| s#td��nt||�}| dkr;|dur:t|t �s:t |�}nd}ddg}
|
�
t| ||||d�� |
�| � |
�|� |dur`|
�|� t
|
||||d|d �S )z�
Common code for config.get_* functions, builds and runs the git CLI command
and returns the result dict for the calling function to parse.
�globalFN�*'cwd' argument required unless global=True�--get-regexpr �config��output_encoding��cwd�user�password�ignore_retcoder r r )r r �args�clean_kwargs�pop�invalid_kwargsr �_expand_path�
isinstance�str�extend�_which_git_config�append�_git_run)Zget_opt�key�value_regexr r r r r �kwargs�global_�commandr r r
�_config_getter7 s>