File: //opt/saltstack/salt/lib/python3.10/site-packages/salt/states/__pycache__/git.cpython-310.pyc
o
�N�gr� � @ s� d Z ddlZddlZddlZddlZddlZddlZddlZddl Zddl
ZddlmZ ddl
m
Z
e�e�Zdd� Zdd� Zd d
� Zdd� Zd
d� Z d4dd�Zd4dd�Zdd� Zd5dd�Zdd� Zd4dd�Zd6dd�Zd4dd�Zd4d d!�Zd"d#� Z $ % & % % ' ' d7d(d)�Z % d8d*d+�Z! & % d9d,d-�Z" d:d.d/�Z# d;d0d1�Z$ d<d2d3�Z%dS )=a3
States to manage git repositories and git configuration
.. important::
Before using git over ssh, make sure your remote host fingerprint exists in
your ``~/.ssh/known_hosts`` file.
.. versionchanged:: 2015.8.8
This state module now requires git 1.6.5 (released 10 October 2009) or
newer.
� N)�CommandExecutionError)�Versionc C s* dt vrdS tt d dd��} | td�kS )z'
Only load if git is available
�git.version)Fzgit module could not be loadedF��versioninfoz1.6.5)�__salt__r )�git_ver� r �C/opt/saltstack/salt/lib/python3.10/site-packages/salt/states/git.py�__virtual__ s r c C sV | du r|dus|du r| durdS | | u rdu rdS |dkr'| � |�S | |kS )z�
Shorthand helper function for comparing SHA1s. If rev_type == 'sha1' then
the comparison will be done using str.startwith() to allow short SHA1s to
compare successfully.
NOTE: This means that rev2 must be the short rev.
NFT�sha1)�
startswith)Zrev1Zrev2Zrev_typer r r
�_revs_equal'