ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib/python3.11/site-packages/git/index/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib/python3.11/site-packages/git/index/__pycache__/util.cpython-311.pyc

�

�܋f���Z�dZddlmZddlZddlZddlZddlmZddlm	Z	ddl
mZddl
mZmZmZmZmZddlmZmZerddlmZd	ZejZejZGd
�de��Zded
efded
effd�Zded
efded
effd�Zded
efded
effd�ZdS)z!Module containing index utilities�)�wrapsN)�
TracebackType)�is_win)�Any�Callable�
TYPE_CHECKING�Optional�Type)�PathLike�_T)�	IndexFile)�TemporaryFileSwap�post_clear_cache�
default_index�git_working_dirc�v�eZdZdZdZdeddfd�Zdd�Zdee	e
d	ee
d
eedefd�Z
dS)
rz�Utility class moving a file to a temporary location within the same directory
    and moving it back on to where on object deletion.)�	file_path�
tmp_file_pathr�returnNc���||_t|j��tjddd��z|_	tj|j|j��dS#t$rYdSwxYw)N�)r�str�tempfile�mktempr�os�rename�OSError)�selfrs  �_/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/git/index/util.py�__init__zTemporaryFileSwap.__init__*sr��"��� ���0�0�8�?�2�r�2�3N�3N�N���	��I�d�n�d�&8�9�9�9�9�9���	�	�	��D�D�	���s�A�
A(�'A(c��|S�N�)rs r�	__enter__zTemporaryFileSwap.__enter__3s�����exc_type�exc_val�exc_tbc���tj|j��rXtr2tj|j��rt
j|j��t
j|j|j��dS)NF)	�osp�isfilerr�existsrr�remover)rr&r'r(s    r�__exit__zTemporaryFileSwap.__exit__6sb���:�d�(�)�)�	:��
*�#�*�T�^�4�4�
*��	�$�.�)�)�)��I�d�(�$�.�9�9�9��ur%)rr)�__name__�
__module__�__qualname__�__doc__�	__slots__rr r$r	r
�
BaseExceptionr�boolr.r#r%rrr#s�������:�:�/�I��(��t�����������4�
�.�/���-�(����'�	�

������r%r�func.rc	�l��t���dddtdtdtf�fd���}|S)a�Decorator for functions that alter the index using the git command. This would
    invalidate our possibly existing entries dictionary which is why it must be
    deleted to allow it to be lazily reread later.

    :note:
        This decorator will not be required once all functions are implemented
        natively which in fact is possible, but probably not feasible performance wise.
    rr
�args�kwargsrc�H���|g|�Ri|��}|���|Sr")�_delete_entries_cache)rr8r9�rvalr6s    �r�post_clear_cache_if_not_raisedz8post_clear_cache.<locals>.post_clear_cache_if_not_raisedQs9����t�D�*�4�*�*�*�6�*�*���"�"�$�$�$��r%�rrr)r6r=s` rrrGsY����4�[�[��[����PS��XZ�������[��*�)r%c	�l��t���dddtdtdtf�fd���}|S)z�Decorator assuring the wrapped method may only run if we are the default
    repository index. This is as we rely on git commands that operate
    on that index only.rr
r8r9rc���|j|���krtd�jz����|g|�Ri|��S)NzECannot call %r on indices that do not represent the default git index)�
_file_path�_index_path�AssertionErrorr/)rr8r9r6s   �r�check_default_indexz*default_index.<locals>.check_default_indexas\����?�d�.�.�0�0�0�0� �W�Z^�Zg�g���
��t�D�*�4�*�*�*�6�*�*�*r%r>)r6rDs` rrr\sW���
�4�[�[�+�+�+�c�+�S�+�R�+�+�+�+�+��[�+��r%c	�l��t���dddtdtdtf�fd���}|S)z�Decorator which changes the current working dir to the one of the git
    repository in order to assure relative paths are handled correctlyrr
r8r9rc����tj��}tjt|jj����	�|g|�Ri|��tj|��S#tj|��wxYwr")r�getcwd�chdirr�repo�working_tree_dir)rr8r9�cur_wdr6s    �r�set_git_working_dirz,git_working_dir.<locals>.set_git_working_dirrsv��������
���T�Y�/�0�0�1�1�1�	��4��.�t�.�.�.�v�.�.��H�V������B�H�V�������s�A!�!A7r>)r6rLs` rrrnsW����4�[�[��+��c��S��R�������[���r%) r2�	functoolsrr�structr�typesr�
git.compatr�os.path�pathr*�typingrrrr	r
�	git.typesrr�	git.indexr
�__all__�pack�unpack�objectrrrrr#r%r�<module>rZs���'�'�������	�	�	�	�
�
�
�
�����������������������
@�?�?�?�?�?�?�?�?�?�?�?�?�?�"�"�"�"�"�"�"�"��$�#�#�#�#�#�#�
X���{��	������������H*�8�C��G�,�*��#�r�'�1B�*�*�*�*�*���b��)��h�s�B�w�.?�����$�(�3��7�+����b��0A������r%

Zerion Mini Shell 1.0