ok

Mini Shell

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

�

�܋f�!����dZddlmZddlmZmZddlmZmZm	Z	m
Z
mZmZm
Z
mZerddlmZddlmZeeeefZe
edfZdZd	e
ed
edge
edffddfd
�Zdedeefd�Zde	ededededef
d�Zedddeddfd���Zedededefd���Zdededefd�Zddde
e
edfdedeeedffd�Zdddededeefd �ZdS)!zBModule with functions which are supposed to be as fast as possible�)�S_ISDIR)�safe_decode�defenc)�Callable�List�MutableSequence�Sequence�Tuple�
TYPE_CHECKING�Union�overload)�ReadableBuffer)�GitCmdObjectDBN)�tree_to_stream�tree_entries_from_data�traverse_trees_recursive�traverse_tree_recursive�entries�writer�returnc
�v�td��}d}|D]�\}}}d}td��D]!}t||dzz	|z|zg��|z}�"|d|kr
|dd�}t|t��r|�t��}	n|}	|d�|d	|	d
|f������dS)z�Write the give list of entries into a stream using its write method

    :param entries: **sorted** list of tuples with (binsha, mode, name)
    :param write: write method which takes a data string�0����r�N� �)�ord�range�bytes�
isinstance�str�encoder�join)
rr�ord_zero�bit_mask�binsha�mode�name�mode_str�i�
name_bytess
          �`/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/git/objects/fun.pyrr&s���
�3�x�x�H��H�%�E�E����d����q���	U�	U�A����Q���8�;�x�G�H�I�I�H�T�H�H��A�;�(�"�"�����|�H��d�C� � �	����V�,�,�J�J��J�
��c�h�h��$�
�E�6�B�C�C�D�D�D�D�)E�Er�datac��td��}td��}t|��}d}g}||kr�d}|||kr"|dz|||z
z}|dz
}|||k�"|dz
}|}||dkr|dz
}||dk�|||�}t|��}	|dz
}|||dz�}
|dz}|�|
||	f��||k��|S)z�Reads the binary representation of a tree and returns tuples of Tree items

    :param data: data block with tree data (as bytes)
    :return: list(tuple(binsha, mode, tree_relative_path), ...)r� rrr�)r �lenr�append)r0r'�	space_ord�len_datar-�outr*�nsr.r+�shas           r/rrFs'��
�3�x�x�H��C���I��4�y�y�H�	�A�
�C�
�h�,�,���
�1�g��"�"��A�I�$�q�'�H�"4�5�D�
��F�A�	�1�g��"�"�	
�Q������1�g��l�l�
��F�A��1�g��l�l��"�Q�$�Z�
��:�&�&��	
�Q����1�q�2�v�:���
��F���
�
�C��t�$�%�%�%�A�h�,�,�D�Jr�	tree_datar+�is_dir�start_atc� �	||}|r,|d|kr t|d��|krd||<|Sn#t$rYnwxYwt|��D]5\}}|r.|d|kr"t|d��|kr	d||<|cS�6dS)z�return data entry matching the given name and tree mode
    or None.
    Before the item is returned, the respective data item is set
    None in the tree_data list to mark it done�rN)r�
IndexError�	enumerate)r;r+r<r=�item�indexs      r/�
_find_by_namerDus���
���"���	�D��G�t�O�O���Q��(8�(8�F�(B�(B�"&�I�h���K����
�
�
���
����!��+�+�����t��	�D��G�t�O�O���Q��(8�(8�F�(B�(B�#�I�e���K�K�K���4s�59�
A�ArB�path_prefixc��dS�N��rBrEs  r/�
_to_full_pathrJ�����Crc��dSrGrHrIs  r/rJrJ�rKrc�>�|s|S|d|d||dzfS)z$Rebuild entry with given path prefixrrr?rHrIs  r/rJrJ�s-��������G�T�!�W�k�D��G�3�4�4r�odbr�	tree_shas.c
���g}t|��}|D]]}|�g}nAtt|�|���������}|�|���^g}t
|��D]�\}}	t
|	��D]�\}
}|s�d�t|��D��}|||<|\}
}}t|��}t|dz||z��D]"}||z}t|||||
��||<�#|r5|�
t|d�|D���|zdz����n.|�t�fd�|D������d|	|
<��|	dd�=��|S)a�
    :return: list of list with entries according to the given binary tree-shas.
        The result is encoded in a list
        of n tuple|None per blob/commit, (n == len(tree_shas)), where
        * [0] == 20 byte sha
        * [1] == mode as int
        * [2] == path relative to working tree root
        The entry tuple is None if the respective blob/commit did not
        exist in the given tree.
    :param tree_shas: iterable of shas pointing to trees. All trees must
        be on the same level. A tree-sha may be None in which case None
    :param path_prefix: a prefix to be added to the returned paths on this level,
        set it '' for the first iteration
    :note: The ordering of the returned items will be partially lostNc��g|]}d��SrGrH)�.0�_s  r/�
<listcomp>z,traverse_trees_recursive.<locals>.<listcomp>�s��/�/�/��t�/�/�/rrc�&�g|]}|r|dpd��S)rNrH)rR�eis  r/rTz,traverse_trees_recursive.<locals>.<listcomp>�s%��D�D�D�b�2�<�"�Q�%�0�D�D�D�Dr�/c3�8�K�|]}t|���V��dSrG)rJ)rR�erEs  �r/�	<genexpr>z+traverse_trees_recursive.<locals>.<genexpr>�s-����� P� P�1��q�+�!>�!>� P� P� P� P� P� Pr)
r4�listr�stream�readr5rAr!rrD�extendr�tuple)rNrOrE�
trees_data�nt�tree_shar0r8�tir;�iirBr�_shar*r+r<�tios  `               r/rr�s����".0�J�	�Y���B�� � ����)+�D�D��.�s�z�z�(�/C�/C�/H�/H�/J�/J�K�K�L�L�D����$�����-/�C�
#�:�.�.�&�&�
��I�!�)�,�,� 	!� 	!�H�B���
��0�/�U�2�Y�Y�/�/�/�G��G�B�K�#��D�$���T�]�]�F�
�R�!�V�R�"�W�-�-�
P�
P���B�h��,�Z��_�d�F�B�O�O������	
R��
�
�,��D�D�G�D�D�D�#�d�*�S�0��������
�
�5� P� P� P� P�� P� P� P�P�P�Q�Q�Q�!�I�b�M�M�
�a�a�a�L�L��Jrrbc	�.�g}t|�|�������}|D][\}}}t|��r+|�t||||zdz�����@|�||||zf���\|S)a&
    :return: list of entries of the tree pointed to by the binary tree_sha. An entry
        has the following format:
        * [0] 20 byte sha
        * [1] mode as int
        * [2] path relative to the repository
    :param path_prefix: prefix to prepend to the front of all returned pathsrW)rr\r]rr^rr5)rNrbrErr0r:r*r+s        r/rr�s����G�!�#�*�*�X�"6�"6�";�";�"=�"=�>�>�D� �<�<���T�4��4�=�=�	<��N�N�2�3��[�4�=O�RU�=U�V�V�W�W�W�W��N�N�C��{�T�'9�:�;�;�;�;��Nr) �__doc__�statr�
git.compatrr�typingrrrr	r
rrr
�	_typeshedr�gitrr"�intr$�EntryTup�EntryTupOrNone�__all__rr�boolrDrJrrrHrr/�<module>rss���H�H�������+�*�*�*�*�*�*�*�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	�	��#�(�(�(�(�(�(�"�"�"�"�"�"����S��!���x��~�&��
��E�H�X�.�E�x�AQ�@R�TY�Z]�_c�Zc�Td�@d�7e�E�jn�E�E�E�E�@,��,�4��>�,�,�,�,�^�_�^�<��C��QU��ad��iw�����.
����3��4����
���
����s��x����
���5��5�S�5�^�5�5�5�5�K�	�K�&.�u�U�D�[�/A�&B�K�QT�K�	�%���#�
$�%�K�K�K�K�\�!1��U��QT��Y]�^f�Yg������r

Zerion Mini Shell 1.0