ok

Mini Shell

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

�

�܋f�2��j�dZddlmZddlZddlZddlmZddlmZddl	m
Z
ddlmZddl
mZdd	lmZmZmZdd
lmZmZddlmZddlmZddlmZmZmZmZdd
l m!Z!er*ddl m"Z"ddl#m$Z$ddl%m&Z&ddl'm(Z(ddlm)Z)m*Z*m+Z+m,Z,ddl-m.Z.dZ/d:d�Z0d;d�Z1d<d �Z2d=d"�Z3d>d'�Z4	d?d@d.�Z5dAd2�Z6dBd6�Z7dCd9�Z8dS)Dz1Package with general repository related functions�)�annotationsN)�Path)�digits)�WorkTreeRepositoryUnsupported)�Object)�SymbolicReference)�
hex_to_bin�
bin_to_hex�cygpath)�	BadObject�BadName)�Git)�Union�Optional�cast�
TYPE_CHECKING)�
Commit_ish)�PathLike�)�Repo)�GitCmdObjectDB)�	Reference)�Commit�	TagObject�Blob�Tree)�Tag)	�	rev_parse�
is_git_dir�touch�find_submodule_git_dir�name_to_object�
short_to_long�	deref_tag�	to_commit�find_worktree_git_dir�filename�str�returnc�X�t|d��5	ddd��n#1swxYwY|S)N�ab)�open)r's �]/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/git/repo/fun.pyr r 0so��	
�h��	�	�
�
��
�
�
�
�
�
�
�
�
�
�
����
�
�
�
��Os��#�#�d�
'PathLike'�boolc��tj|���rDtjtj|d����sdtjvr�tjtj|d����rdtj|d��}tj|��p:tj|��o&tj|���d��Stjtj|d����r]tjtj|d����r6tjtj|d����rt|���dS)	a{This is taken from the git setup.c:is_git_directory
    function.

    @throws WorkTreeRepositoryUnsupported if it sees a worktree directory. It's quite hacky to do that here,
            but at least clearly indicates that we don't support it.
            There is the unlikely danger to throw if we see directories which just look like a worktree dir,
            but are none.�objects�GIT_OBJECT_DIRECTORY�refs�HEAD�gitdir�	commondir�gitfileF)
�osp�isdir�join�os�environ�isfile�islink�readlink�
startswithr)r.�headrefs  r-rr6s$���y��|�|�3��I�c�h�q�)�,�,�-�-�
	3�1G�2�:�1U�1U�[^�[d��H�Q����\
�\
�1U��h�q�&�)�)�G��:�g�&�&�k�3�:�g�+>�+>�+j�2�;�w�CW�CW�Cb�Cb�ci�Cj�Cj�k��J�s�x��8�,�,�-�-�	3��
�3�8�A�{�3�3�4�4�	3��
�3�8�A�y�1�1�2�2�	3�
0��2�2�2��5��dotgit�
Optional[str]c�L�	tj|��}n#t$rYdSwxYwtj|j��sdS	t|��������}d�|D��D]\}}|dkr|cS�n#t$rYnwxYwdS)z&Search for a gitdir for this worktree.Nc�\�g|])}|����d����*S)z: )�strip�split)�.0�lines  r-�
<listcomp>z)find_worktree_git_dir.<locals>.<listcomp>Xs.��F�F�F��4�:�:�<�<�-�-�d�3�3�F�F�FrCr6)	r<�stat�OSError�S_ISREG�st_moder�	read_text�
splitlines�
ValueError)rD�statbuf�lines�key�values     r-r&r&Ms�����'�&�/�/���������t�t������<���(�(���t�
��V���&�&�(�(�3�3�5�5��F�F��F�F�F�	�	�J�C���h��������	���
�
�
���
�����4s%��
%�%�A
B�B�
B!� B!�Optional['PathLike']c� �t|��r|S	t|��5}|������}ddd��n#1swxYwY|�d��r�|dd�}tj��rt|��}tj	|��s9tj
tjtj|��|����}t|��Sn#t$rYnwxYwdS)zSearch for a submodule repo.Nzgitdir: �)rr,�read�rstriprAr�	is_cygwinrr9�isabs�normpathr;�dirnamer!�IOError)r.�fp�content�paths    r-r!r!`sA���!�}�}����0�
�!�W�W�	)���g�g�i�i�&�&�(�(�G�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)�	)����	)�	)�	)�	)����j�)�)�
	0��1�2�2�;�D��}���
%��t�}�}���9�T�?�?�
D��|�C�H�S�[��^�^�T�$B�$B�C�C��)�$�/�/�/�
	0��	�
�
�
���
���� �4s4�C>�'A�	C>�A�C>�A�C>�>
D�
D�odb�'GitCmdObjectDB'�hexsha�Optional[bytes]c�j�	t|�|����S#t$rYdSwxYw)z�:return: long hexadecimal sha1 from the given less-than-40 byte hexsha
        or None if no candidate could be found.
    :param hexsha: hexsha with less than 40 byteN)r
�partial_to_complete_sha_hexr)rergs  r-r#r#{sE����#�9�9�&�A�A�B�B�B�������t�t����s�!$�
2�2F�repo�'Repo'�name�
return_ref�?Union[SymbolicReference, 'Commit', 'TagObject', 'Blob', 'Tree']c��d}|j�|��r+t|��dkrt|j|��}n|}|�FdD]C}	tj|||z��}|rt|||z��cSn#t$rY�@wxYw|rtd|z���|�t|���tj|t|����S)a
    :return: object specified by the given name, hexshas ( short and long )
        as well as references are supported
    :param return_ref: if name specifies a reference, we will return the reference
        instead of the object. Otherwise it will raise BadObject or BadName
    N�()z%szrefs/%szrefs/tags/%sz
refs/heads/%szrefs/remotes/%szrefs/remotes/%s/HEADz Couldn't find reference named %r)
�re_hexsha_shortened�match�lenr#rer�dereference_recursiverSrr
r�new_from_shar	)rkrmrnrg�bases     r-r"r"�s��'+�F���%�%�d�+�+���t�9�9��?�?�"�4�8�T�2�2�F�F��F��~�
�	�	�D�
�*�@��t�d�{�S�S���@�,�T�4�$�;�?�?�?�?�?�����
�
�
���
�����C��:�T�A�B�B�B��~��d�m�m����t�Z��%7�%7�8�8�8s�,B�
B
�B
�tag�'Tag'�'TagObject'c�<�		|j}n#t$rYnwxYw�|S)z=Recursively dereference a tag and return the resulting object)�object�AttributeError)rxs r-r$r$�sA���	��*�C�C���	�	�	��E�	������Js��
��objr�Union['Commit', 'TagObject']c�t�|jdkrt|��}|jdkrtd|z���|S)z>Convert the given object to a commit if possible and return itrx�commitz'Cannot convert object %r to type commit)�typer$rS)r~s r-r%r%�s@��
�x�5�����n�n��
�x�8����B�S�H�I�I�I��JrC�rev�&Union['Commit', 'Tag', 'Tree', 'Blob']c
��|�d��rtd���d}d}d}d}d}t|��}||k�r�||dvr|dz
}�||}|�n|dkr
|jj}nv|dkr)td	t
||d|�d
�����}nGttt
||d|�����}n|�J�|�td|j��}|dz
}||k�r�||d
k�r�|�	d|��}	|	dkrtd|z���||dz|	�}|dkr�nB|dkrC	tt|��}t|��j}�n#ttf$rYn�wxYw|dvr.td|��}|r|jdkrt|��}n�n�|dkr�|�
Jd���d}
	t!|��dz}
n"#t$r}td��|�d}~wwxYw	|�|
��}n%#t$$r}t%d|
z��|�d}~wwxYwt'j|t+|j����}d}ntd|�d|�d����|r'|r%|j|krtd|�d|j�����|	dz}|}��zd}
|dkrEd}||kr9||t.vr#|
d zt!||��z}
|dz
}d
}nn||k�9|sd}
|}	tt|��}|d!kr/t|��}t1|
��D]}|jd}�ne|d"kr"t|��}|
r|j|
dz
}n=|dkr%|jdkr|j}|||d�}|}ntd#|z���n?#t$tf$r+}t5d$|�d%|�t!|
���d&���|�d}~wwxYw||k���|�%ttt
||����}|}|�td'|z���||krtd(|�d)|d|������|S)*a�
    :return: Object at the given revision, either Commit, Tag, Tree or Blob
    :param rev: git-rev-parse compatible revision specification as string, please see
        http://www.kernel.org/pub/software/scm/git/docs/git-rev-parse.html
        for details
    :raise BadObject: if the given revision could not be found
    :raise ValueError: If rev couldn't be parsed
    :raise IndexError: If invalid reflog index is specifiedz:/z"commit by message search ( regex )Nr�rz^~:@r�@rT)rnr�{�}���z*Missing closing brace to define type in %s�tree)��blobrrxz"Require Reference to access reflogz3Support for additional @{...} modes not implementedzInvalid revlog index: %ir�zInvalid output type: z ( in z )z,Could not accommodate requested object type z, got �:F�
�~�^zInvalid token: %rzInvalid revision spec 'z(' - not enough parent commits to reach '�'z*Revision specifier could not be parsed: %sz!Didn't consume complete rev spec z, consumed part: )rA�NotImplementedErrorrt�head�refrr"rr��findrSr%r�r}r�r$�int�	log_entry�
IndexErrorrrvr	�	newhexshar�range�parentsr
)rkr�r~r��output_type�start�	parsed_to�lr�token�end�revlog_index�e�entry�num�found_digit�_s                r-rr�s����~�~�d���H�!�"F�G�G�G�15�C�
�C��K�
�E��I�	�S���B�
�"�*�*��u�:�V�#�#��Q�J�E���E�
���;���z�z��i�m����C�<�<��{�N�4��V�e�V��Y]�,^�,^�,^�_�_�C�C��z�>�$��F�U�F��+L�+L�M�M�C�C��?�?�?����8�S�Z�0�0��	��
���2�:�:�#�e�*��+�+��(�(�3��&�&�C��b�y�y� �!M�PS�!S�T�T�T��e�a�i�#�o�.�K��h�&�&����&�&���z�3�/�/�C�#�C�.�.�-�C�C��&�
�3�����D�������,�,��;��,�,����3�8�u�,�,�#�C�.�.�C�C���#������(L����#��l�%(��%5�%5��%9�#:�L�L��!�l�l�l�.�.c�d�d�jk�k�����l����W��M�M�,�7�7�E�E��!�W�W�W�$�%?�,�%N�O�O�UV�V�����W�����)�$�
�5�?�0K�0K�L�L��!��� �j����UX�UX�UX�!Y�Z�Z�Z��
u�s�
u�s�x�;�'>�'>� �j�]h�]h�]h�jm�jr�jr�!s�t�t�t��!�G�E��I�����C�<�<��K��"�*�*��u�:��'�'���(�S��U��_�_�4�C��Q�J�E�"&�K�K��
�"�*�*��
����	�	��z�3�'�'�C���|�|���n�n���s���)�)�A��+�a�.�C�C�)��#�����n�n���/��+�c�A�g�.�C���#����8�v�%�%��(�C��#�e�f�f�+�&���	�	� �!4�u�!<�=�=�=����N�+�	�	�	��m�#�m�m�[`�m�be�fi�bj�bj�m�m�m����
�����	����O�"�*�*�^�{��:�~�d�C�8�8�9�9���	��{��E��K�L�L�L��B����j�UX�UX�UX�Z]�^h�_h�^h�Zi�Zi�j�k�k�k��Js[�)E6�6F
�	F
�G(�(
H�2H�H�H!�!
I�+H>�>I�B/N8�8O4�	&O/�/O4)r'r(r)r()r.r/r)r0)rDr/r)rE)r.r/r)rX)rerfrgr(r)rh)F)rkrlrmr(rnr0r)ro)rxryr)rz)r~rr)r)rkrlr�r(r)r�)9�__doc__�
__future__rr<rM�pathlibr�stringr�git.excr�git.objectsr�git.refsr�git.utilr	r
r�	gitdb.excrr
�os.pathrdr9�git.cmdr�typingrrrr�	git.typesrrrwr�git.dbr�git.refs.referencerrrrr�git.refs.tagr�__all__r rr&r!r#r"r$r%r�rCr-�<module>r�s���7�7�"�"�"�"�"�"�	�	�	�	�����������������1�1�1�1�1�1�������&�&�&�&�&�&�4�4�4�4�4�4�4�4�4�4���������
������������8�7�7�7�7�7�7�7�7�7�7�7� � � � � � ��!�"�"�"�"�"�"�������%�%�%�%�%�%�,�,�,�,�,�,�9�9�9�9�9�9�9�9�9�9�9�9� � � � � � �
����������.����&����6����16�59�59�59�59�59�p��������p�p�p�p�p�prC

Zerion Mini Shell 1.0