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__/fun.cpython-311.pyc

�

�܋f@��T�ddlmZddlmZddlZddlmZmZmZm	Z	m
Z
mZmZddl
Z
ddlmZmZddlmZmZmZmZmZmZddlmZmZddlmZmZmZdd	lm Z m!Z!dd
l"m#Z#ddl$m%Z%ddl&m'Z(dd
l)m*Z*m+Z+m,Z,m-Z-ddl.m/Z/m0Z0ddl1m2Z2m3Z3m4Z4m5Z5m6Z6m7Z7m8Z8m9Z9m:Z:ddl;m<Z<e6rddl=m>Z>ddl?m@Z@ddlAmBZBeezZCe,ZDdZEdeFde<deFfd�ZGd�ZHdeFdddeFddfd�ZIdeJdeJfd�ZKde fd e5e9e*d!fd"e3eLd#e9deLfd$e8e ddf
d%�ZMd"e3eLde7eJeJffd&�ZNd'e9e*e<eJfde7e<eJffd(�ZOd"e3eLde7eJe2e7e<eJfd!feLeLffd)�ZP	d5d e4e+d*d+d,eQd-eJde7eLe4d.ff
d/�ZRd0d.d1eJde*fd2�ZSd*d+d3e5eLde4e*fd4�ZTdS)6�)�BytesIO)�PathN)�S_IFDIR�S_IFLNK�S_ISLNK�S_ISDIR�S_IFMT�S_IFREG�S_IXUSR)�PROC_CREATIONFLAGS�handle_process_output)�defenc�
force_text�force_bytes�is_posix�is_win�safe_decode)�UnmergedEntriesError�HookExecutionError)�tree_to_stream�traverse_tree_recursive�traverse_trees_recursive)�IndexFileSHA1Writer�finalize_process)�IStream)�
str_tree_type�)�BaseIndexEntry�
IndexEntry�CE_NAMEMASK�
CE_STAGESHIFT)�pack�unpack)	�Dict�IO�List�Sequence�
TYPE_CHECKING�Tuple�Type�Union�cast)�PathLike)�	IndexFile)�GitCmdObjectDB)�TreeCacheTup)�write_cache�
read_cache�write_tree_from_cache�	entry_key�stat_mode_to_index_mode�S_IFGITLINK�run_commit_hook�	hook_path�name�git_dir�returnc�.�tj|d|��S)zK:return: path to the given named hook in the given git repository directory�hooks)�osp�join)r9r:s  �^/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/git/index/fun.pyr8r8Js���8�G�W�d�+�+�+�c�6�tj|��dS)Nr)r>�splitext)�paths r@�_has_file_extensionrEOs���<����a� � rA�indexr.�argsc	���t||jj��}tj|tj��sdStj���}tt|j
����|d<d|d<|g}	trQt|��sBt|���|jj�����}d|g}t#j|t'|��z|t"jt"j|jjt*t,���}g}g}t/||j|jt2��d�|��}	d�|��}
|jdkrAt9|	t:��}	t9|
t:��}
t=||j|
|	���dS#t>$r}t=||��|�d}~wwxYw)	z�Run the commit hook of the given name. Silently ignores hooks that do not exist.

    :param name: name of hook, like 'pre-commit'
    :param index: IndexFile instance
    :param args: arguments passed to hook file
    :raises HookExecutionError:N�GIT_INDEX_FILE�:�
GIT_EDITORzbash.exe)�env�stdout�stderr�cwd�	close_fds�
creationflags�r) r8�repor:�os�access�X_OK�environ�copyr�strrDrrEr�relative_to�working_dir�as_posix�
subprocess�Popen�list�PIPErrr
�appendrr?�
returncoderrr�	Exception)r9rFrG�hprL�cmd�relative_hp�stdout_list�stderr_listrMrN�exs            r@r7r7Ss���
�4���+�	,�	,�B�
�9�R���!�!���t�
�*�/�/�
�
�C�'��E�J���8�8�C����C���
�$�C�I��	,�-�b�1�1�	,��r�(�(�.�.�u�z�/E�F�F�O�O�Q�Q�K��{�+�C����$�t�*�*����?��?��
�&��,�
�
�
��"$��!#���c�;�#5�{�7I�K[�\�\�\�����%�%������%�%���>�Q������/�/�F����/�/�F�$�R�����H�H�H�����1�1�1� ��R�(�(�b�0�����1���s�B+G�
G/�G*�*G/�modec��t|��rtSt|��st|��tkrtSt
|tzrdpdzS)zYConvert the given mode from a stat call to the corresponding index mode
    and return iti�i�)rrrr	r6r
r)rjs r@r5r5�sT���t�}�}�����t�}�}���t����3�3����d�W�n�.��7�%�8�8rA�entriesr�stream�extension_data�ShaStreamClsc�B�||��}|j}|j}d}|d��|td|t|������|D�]"}|��}	||j��||j��t
|j��}
t|
t���}t|��tz}|t|��ksJd|jz���||jtzz}
|td|j
|j|j|j|j|j|j|
�	�	��||��|��|	z
dzdz}|d	|	|z|��z
z����$|�|�|��|���d
S)a�Write the cache represented by entries to a stream

    :param entries: **sorted** list of entries
    :param stream: stream to wrap into the AdapterStreamCls - it is used for
        final output.

    :param ShaStreamCls: Type to use when writing to the stream. It produces a sha
        while writing to it, before the data is passed on to the wrapped stream

    :param extension_data: any kind of data to write as a trailer, it must begin
        a 4 byte identifier, followed by its size ( 4 bytes )��DIRC�>LL)�encodingz"Path %s too long to fit into index�>LLLLLL20sH�����N)�tell�writer"�len�ctime_bytes�mtime_bytesrYrDrrr �flags�CE_NAMEMASK_INV�dev�inoderj�uid�gid�size�binsha�	write_sha)rlrmrnro�
stream_sharyrz�version�entry�beginoffset�path_strrD�plenr~�	real_sizes               r@r1r1�s���$��f�%�%�J��?�D���E��G�	�E�'�N�N�N�	�E�$�u�g�s�7�|�|�
,�
,�-�-�-��<�<���d�f�f��
��e�� � � �
��e�� � � ��u�z�?�?��!�(�V�<�<�<���4�y�y�;�&���s�4�y�y� � � �"F���"S� � � ����o�5�6��
�����	����
��	��	��
����

�

�	
�	
�	
�	��d�����T�V�V�k�)�A�-��3�	�
��e��i�/�4�4�6�6�9�:�;�;�;�;��!�����(�(�(��������rAc	�
�|�d��}|dkrtd|z���ttttftd|�d������}|\}}|dvsJ�||fS)z=Return tuple(version_long, num_entries) from the given stream�rrzInvalid index file header: %rrsrv�rrq)�read�AssertionErrorr,r)�intr#)rm�type_id�unpackedr��num_entriess     r@�read_headerr��s����k�k�!�n�n�G��'����<�w�F�G�G�G��E�#�s�(�O�V�E�6�;�;�u�3E�3E�%F�%F�G�G�H�#��G�[��f������K��rAr�c���t|��dkr-|d}t|t��sJ�|j|jfSttttf|��}|S)z�:return: Key suitable to be used for the index.entries dictionary
    :param entry: One instance of type BaseIndexEntry or the path and the stagerr)	r{�
isinstancerrD�stager,r)r-r�)r��entry_firsts  r@r4r4�sb���5�z�z�Q����A�h���+�~�6�6�6�6�6�� �+�"3�4�4��U�8�S�=�)�5�1�1���rAc
��t|��\}}d}i}|j}|j}||kr�|��}td|d����d}td|d����d}	td|d����\}
}}}
}}}}|tz}||���t��}|��|z
dzdz}|||z|��z
��t||||||	|
||
||f��}||||jf<|dz
}||k��|�d��}t|��d	ksJd
t|��z���|dd�}|dd�}||||fS)
a�Read a cache file from the given stream

    :return: tuple(version, entries_dict, extension_data, content_sha)

      * version is the integer version number
      * entries dict is a dictionary which maps IndexEntry instances to a path at a stage
      * extension_data is '' or 4 bytes of type + 4 bytes of size + size bytes
      * content_sha is a 20 byte sha on all cache file contentsrz>8srvru�.rwr����zNIndex Footer was not at least a sha on content as it was only %i bytes in sizei��N)
r�r�ryr#r �decoderrr�r{)rmr�r��countrlr�ryr��ctime�mtimer��inorjr�r�r��shar~�	path_sizerDr�r�rn�content_shas                        r@r2r2�s���'�v�.�.��G�[�
�E�8:�G��;�D��;�D�
�+�
�
��d�f�f���u�d�d�1�g�g�&�&�q�)���u�d�d�1�g�g�&�&�q�)��7=�m�T�T�R`�Ma�Ma�7b�7b�4��c�4��c�4��e��K�'�	��t�I���%�%�f�-�-���T�V�V�k�)�A�-��3�	���k�I�%�����
/�0�0�0��D�#�u�d�E�5�#�s�C�QT�VZ�[�\�\��',���u�{�#�$�
��
���+�
�
�,�[�[��_�_�N��N���b� � � �W�Z]�^l�Zm�Zm�m�	!� � �!����&�K�$�D�S�D�)�N��W�n�k�:�:rA�odbr/�sl�sir0c	��g}|j}|j}||k�r&||}|jdkrt|���|dz
}|j�d|��}|dkr0|�|j|j|j|d�f��n�|j||�}	|}
|
|krH||
}|j�d|��}|dks|j||�|	krn|
dz
}
|
|k�Ht||t|dz
|
��|dz��\}
}|�|
t|	f��|
}||k��&t��}t||j��|�d��|�t#t$t'|�����|����}|j|fS)a�Create a tree from the given sorted list of entries and put the respective
    trees into the given object database

    :param entries: **sorted** list of IndexEntries
    :param odb: object database to store the trees in
    :param si: start index at which we should start creating subtrees
    :param sl: slice indicating the range we should process on the entries list
    :return: tuple(binsha, list(tree_entry, ...)) a tuple of a sha and a list of
        tree entries being a tuple of hexsha, mode, namerr�/r�N)�start�stopr�rrD�findrar�rjr3�slicerrrrz�seek�storerrr{�getvalue)rlr�r�r��
tree_items�ci�endr��rbound�base�xi�oentry�orboundr��_tree_entry_list�sio�istreams                 r@r3r3s���(*�J�	��B�
�'�C�
�s�(�(������;�!���&�u�-�-�-�
�a��������b�)�)���R�<�<����u�|�U�Z���B�C�C��I�J�J�J�J��:�b��i�(�D��B��s�(�(� ���� �+�*�*�3��3�3���b�=�=�F�K��7�
�$;�t�$C�$C���a���
�s�(�(�%:�'�3��b�ST�f�VX�HY�HY�[a�de�[e�$f�$f�!�C�!����s�G�T�2�3�3�3��B�;
�s�(�(�D�)�)�C��:�s�y�)�)�)��H�H�Q�K�K�K��i�i��
�s�3�<�<�>�>�/B�/B�C�H�H�I�I�G��N�J�'�'rA�
tree_entryr�c�\�t|d|d|tz|df��S)Nrrrq)rr!)r�r�s  r@�_tree_entry_to_baseindexentryr�Xs-���:�a�=�*�Q�-��-�9O�Q[�\]�Q^�_�`�`�`rA�	tree_shasc�V�g}t|��dvr?t||dd��D]%}|�t|d�����&|St|��dkrt	dt|��z���t||d��D�]\}}}|��&|���|��D|d|dkr$|d|dkr|d|dks6|d|dkr�|d|dkr||d|dkrj|�t|d����|�t|d	����|�t|d������|d|dks|d|dkr%|�t|d������/|�t|d������T|d|dks|d|dkrF|�t|d����|�t|d	�������|����|d|dks|d|dkrF|�t|d����|�t|d������0|�)|�J�|�t|d������[|�%|�t|d�������|d|dks|d|dkrH|�t|d	����|�t|d�������|�t|d������|S)
a
    :return: list of BaseIndexEntries representing the aggressive merge of the given
        trees. All valid entries are on stage 0, whereas the conflicting ones are left
        on stage 1, 2 or 3, whereas stage 1 corresponds to the common ancestor tree,
        2 to our tree and 3 to 'their' tree.
    :param tree_shas: 1, 2 or 3 trees as identified by their binary 20 byte shas
        If 1 or two, the entries will effectively correspond to the last given tree
        If 3 are given, a 3 way merge is performedr�r�rRr�zCannot handle %i trees at onceNrrq)r{rrar��
ValueErrorr)r�r��outr�r��ours�theirss       r@�aggressive_tree_merger�\s���!#�C��9�~�~����,�S�)�B�-��D�D�	@�	@�E��J�J�4�U�A�>�>�?�?�?�?��
��9�~�~�����9�C�	�N�N�J�K�K�K�7�s�I�r�J�J�BG�BG���d�F������%��Q��4��7�*�*�t�A�w�&��)�/C�/C��Q��SY�Z[�S\�H\�H\��Q��4��7�*�*�t�A�w�&��)�/C�/C��Q��SY�Z[�S\�H\�H\��
�
�#@��q�#I�#I�J�J�J��
�
�#@��q�#I�#I�J�J�J��
�
�#@���#K�#K�L�L�L�L��a��D��G�+�+�t�A�w�$�q�'�/A�/A��
�
�#@��q�#I�#I�J�J�J�J��
�
�#@���#K�#K�L�L�L�L��A�w�$�q�'�)�)�T�!�W��Q��-?�-?��
�
�#@��q�#I�#I�J�J�J��
�
�#@��q�#I�#I�J�J�J���>���a�y�D��G�+�+�v�a�y�D��G�/C�/C��
�
�#@��q�#I�#I�J�J�J��
�
�#@���#K�#K�L�L�L���|��)�)�)��
�
�8���C�C�D�D�D�D����
�
�8��q�A�A�B�B�B�B���7�f�Q�i�'�'�4��7�f�Q�i�+?�+?��J�J�<�T�1�E�E�F�F�F��J�J�<�V�Q�G�G�H�H�H�H��J�J�<�T�1�E�E�F�F�F�F��JrA)r)U�ior�pathlibrrT�statrrrrr	r
rr]�git.cmdrr
�
git.compatrrrrrr�git.excrr�git.objects.funrrr�git.utilrr�
gitdb.baser�	gitdb.typr�os.pathrDr>�typrrr r!�utilr"r#�typingr$r%r&r'r(r)r*r+r,�	git.typesr-r�r.�git.dbr/�git.objects.treer0r6r�__all__rYr8rEr7r�r5�bytesr1r�r4r2r�r3r�r��rAr@�<module>r�s��
������������	�	�	�	�����������������������=�=�=�=�=�=�=�=�����������������=�<�<�<�<�<�<�<�����������
;�:�:�:�:�:�:�:�������#�#�#�#�#�#�������G�G�G�G�G�G�G�G�G�G�G�G���������U�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T�T��������.�������%�%�%�%�%�%�-�-�-�-�-�-������,��	��,�C�,�(�,�s�,�,�,�,�
!�!�!�*I�#�*I�k�*I�#�*I�$�*I�*I�*I�*I�\9�#�9�#�9�9�9�9�*.�.A�	=�=�
�e�N�L�8�9�
:�=��u�I�=��$��+�&�=��*�+�	=�

�=�=�=�=�@
 ��5�	�
 �e�C��H�o�
 �
 �
 �
 ��e�N�H�c�9�:��u�X�s�]�?S�����$1;��u�I�1;�
�3��U�8�S�=�)�<�7�8�%��F�G�1;�1;�1;�1;�jLM�7(�7(�
�*�
�7(�$4�7(�:?�7(�EH�7(�
�5�$�~�&�&�'�7(�7(�7(�7(�ta�n�a�S�a�^�a�a�a�a�`�/�`�H�U�O�`�PT�Uc�Pd�`�`�`�`�`�`rA

Zerion Mini Shell 1.0