ok

Mini Shell

Direktori : /opt/cloudlinux/venv/lib64/python3.11/site-packages/git/refs/__pycache__/
Upload File :
Current File : //opt/cloudlinux/venv/lib64/python3.11/site-packages/git/refs/__pycache__/head.cpython-311.pyc

�

�܋f&����ddlmZmZddlmZddlmZddlmZddl	m
Z
ddlmZm
Z
mZmZddlmZmZerdd	lmZdd
lmZddlmZdd
gZdedefd�ZGd�de��ZGd�d
e
��ZdS)�)�GitConfigParser�SectionConstraint)�	join_path)�GitCommandError�)�SymbolicReference)�	Reference)�Any�Sequence�Union�
TYPE_CHECKING)�PathLike�
Commit_ish)�Repo)�Commit��RemoteReference�HEAD�Head�string�returnc�n�|�d��r|�d��r
|dd�S|S)N�"r���)�
startswith�endswith)rs �^/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/git/refs/head.py�strip_quotesrs>��
�������&�/�/�#�"6�"6���a��d�|���M�c
���eZdZdZdZdZdZefdddef�fd�
Zde	fd	�Z
				dd
eee	e
fdededeeeedfdeddfd�Z�xZS)rzZSpecial case of a Symbolic Reference as it represents the repository's
    HEAD reference.�	ORIG_HEAD��repor�pathc���||jkrtd|j�d|�����tt|���||��|dS)NzHEAD instance must point to z, got )�
_HEAD_NAME�
ValueError�superr�__init__)�selfr#r$�	__class__s   �rr)z
HEAD.__init__'s[����4�?�"�"��*�����Z^�Z^�_�`�`�`�
�d�D���"�"�4��.�.�.����rrc�6�t|j|j��S)z�
        :return: SymbolicReference pointing at the ORIG_HEAD, which is maintained
            to contain the previous value of HEAD)rr#�_ORIG_HEAD_NAME�r*s r�	orig_headzHEAD.orig_head-s��!���D�,@�A�A�ArTFN�commit�index�working_tree�paths�kwargsc���d}|rd}|rd}|rd}|std���	|jjj||d|fi|��n##t$r}|jdkr�Yd}~nd}~wwxYw|S)a�Reset our HEAD to the given commit optionally synchronizing
        the index and working tree. The reference we refer to will be set to
        commit as well.

        :param commit:
            Commit object, Reference Object or string identifying a revision we
            should reset HEAD to.

        :param index:
            If True, the index will be set to match the given commit. Otherwise
            it will not be touched.

        :param working_tree:
            If True, the working tree will be forcefully adjusted to match the given
            commit, possibly overwriting uncommitted changes without warning.
            If working_tree is True, index must be true as well

        :param paths:
            Single path or list of paths relative to the git root directory
            that are to be reset. This allows to partially reset individual files.

        :param kwargs:
            Additional arguments passed to git-reset.

        :return: selfz--softz--mixedNz--hardz?Cannot reset the working tree if the index is not reset as wellz--r)r'r#�git�resetr�status)r*r0r1r2r3r4�mode�es        rr7z
HEAD.reset3s���D���	��D��
����	d��D��
d� �!b�c�c�c�	��D�I�M���f�d�E�D�D�V�D�D�D�D���	�	�	��x�1�}�}���}�}�}�}�����	�����s�=�
A�A�A)rTFN)�__name__�
__module__�__qualname__�__doc__r&r-�	__slots__rr)rr/rr�str�boolrr
r7�
__classcell__)r+s@rrrs����������J�!�O��I�6@���V��8�������B�,�B�B�B�B�=C��"�;?�=�=��j�"3�S�8�9�=��=��	=�
�X�x��1�4�7�8�=��
=�
�=�=�=�=�=�=�=�=rc��eZdZdZdZdZdZedd�ddd	d
dede	d
df
d���Z
dedd
dfd�Zd
edfd�Z
ddeded
dfd�Zddede	d
edfd�Zded
eefd�Zd
eefd�Zd
eefd�ZdS)ra�A Head is a named reference to a Commit. Every Head instance contains a name
    and a Commit object.

    Examples::

        >>> repo = Repo("/path/to/repo")
        >>> head = repo.heads[0]

        >>> head.name
        'master'

        >>> head.commit
        <git.Commit "1c09f116cbc2cb4100fb6935bb162daa4723f455">

        >>> head.commit.hexsha
        '1c09f116cbc2cb4100fb6935bb162daa4723f455'z
refs/heads�remote�mergeF)�forcer#r�headszUnion[Head, str]rFr4rNc�8�d}|rd}|jj|g|�R�dS)z�Delete the given heads

        :param force:
            If True, the heads will be deleted even if they are not yet merged into
            the main development stream.
            Default Falsez-dz-DN)r6�branch)�clsr#rFrGr4�flags      r�deletezHead.delete�s8�����	��D������%�u�%�%�%�%�%�%r�remote_reference)rNc�B�ddlm}|�"t||��std|z���|���5}|�n|�|j��|�|j��t|�	����dkr|�
��nX|�|j|j��|�|jt�|j����ddd��n#1swxYwY|S)a
        Configure this branch to track the given remote reference. This will alter
            this branch's configuration accordingly.

        :param remote_reference: The remote reference to track or None to untrack
            any references
        :return: selfrrNzIncorrect parameter type: %rr)rDr�
isinstancer'�
config_writer�
remove_option�k_config_remote�k_config_remote_ref�len�options�remove_section�	set_value�remote_namer�to_full_path�remote_head)r*rMr�writers    r�set_tracking_branchzHead.set_tracking_branch�sb��	,�+�+�+�+�+��'�
�;K�_�0]�0]�'��;�>N�N�O�O�O��
�
�
!�
!�	�V��'��$�$�T�%9�:�:�:��$�$�T�%=�>�>�>��v�~�~�'�'�(�(�A�-�-��)�)�+�+�+��� � ��!5�7G�7S�T�T�T�� � ��,��%�%�&6�&B�C�C����	�	�	�	�	�	�	�	�	�	�	����	�	�	�	��s�C	D�D�Dc
���ddlm}|���}|�|j��r�|�|j��r�t
|jt�t|�
|j��������}|jt|�
|j��|j����}||j|��SdS)zk
        :return: The remote_reference we are tracking, or None if we are
            not a tracking branchrrN)
rDr�
config_reader�
has_optionrRrSrr#rYr�	get_valuer�name)r*r�reader�ref�remote_refpaths     r�tracking_branchzHead.tracking_branch�s���	,�+�+�+�+�+��#�#�%�%�����T�1�2�2�	>�v�7H�7H��Ia�7b�7b�	>���	��!�!�,�v�/?�/?��@X�/Y�/Y�"Z�"Z�[�[���C�:�_�9�)�F�DT�DT�UY�Ui�Dj�Dj�lo�lt�:u�:u�v�v�N�"�?�4�9�n�=�=�=��tr�new_pathc�v�d}|rd}|jj�|||��|j�d|��|_|S)a�Rename self to a new path

        :param new_path:
            Either a simple name or a path, i.e. new_name or features/new_name.
            The prefix refs/heads is implied

        :param force:
            If True, the rename will succeed even if a head with the target name
            already exists.

        :return: self
        :note: respects the ref log as git commands are usedz-mz-M�/)r#r6rI�_common_path_defaultr$)r*rfrFrKs    r�renamezHead.rename�sN�����	��D��	�
���T�4��2�2�2�#�8�8�8�(�(�C��	��r)rrc���||d<|ddur|�d��|jjj|fi|��|jjjr|jjS|jjS)arCheckout this head by setting the HEAD to this reference, by updating the index
        to reflect the tree we point to and by updating the working tree to reflect
        the latest index.

        The command will fail if changed working tree files would be overwritten.

        :param force:
            If True, changes to the index and the working tree will be discarded.
            If False, GitCommandError will be raised in that situation.

        :param kwargs:
            Additional keyword arguments to be passed to git checkout, i.e.
            b='new_branch' to create a new branch at the given spot.

        :return:
            The active branch after the checkout operation, usually self unless
            a new branch has been created.
            If there is no active branch, as the HEAD is now detached, the HEAD
            reference will be returned instead.

        :note:
            By default it is only allowed to checkout heads - everything else
            will leave the HEAD detached which is allowed and possible, but remains
            a special state that some tools might not be able to handle.�fF)�popr#r6�checkout�head�is_detached�
active_branch)r*rFr4s   rrnz
Head.checkout�sn��2��s���#�;�%����J�J�s�O�O�O���	�
��t�.�.�v�.�.�.��9�>�%�	+��9�>�!��9�*�*r�	read_onlyc��|r|j���}n|j���}t|d|jz��S)Nzbranch "%s")r#r^rPrra)r*rr�parsers   r�_config_parserzHead._config_parsersK���	/��Y�,�,�.�.�F�F��Y�,�,�.�.�F�!�����)B�C�C�Crc�.�|�d���S)zm
        :return: A configuration parser instance constrained to only read
            this instance's valuesT�rr�rur.s rr^zHead.config_reader	s���"�"�T�"�2�2�2rc�.�|�d���S)zp
        :return: A configuration writer instance with read-and write access
            to options of this headFrwrxr.s rrPzHead.config_writers���"�"�U�"�3�3�3r)F)r;r<r=r>rirRrS�classmethodrAr
rLrr\rerrjrnrrrur^rPr"rrrrss�������6�6�"(���O�!���LQ�
&�
&�
&�&�
&�*<�
&�T�
&�]`�
&�ei�
&�
&�
&��[�
&��E�:Q�4R��W]�����:��'>�!?�����&��x���������*!+�!+�d�!+�c�!+�e�N�>S�!+�!+�!+�!+�HD��D�1B�?�1S�D�D�D�D�3�0��A�3�3�3�3�4�0��A�4�4�4�4�4�4rN)�
git.configrr�git.utilr�git.excr�symbolicr�	referencer	�typingr
rrr
�	git.typesrr�git.repor�git.objectsr�git.refsr�__all__r@rrrr"rr�<module>r�s���9�9�9�9�9�9�9�9�������#�#�#�#�#�#�'�'�'�'�'�'� � � � � � �7�6�6�6�6�6�6�6�6�6�6�6�*�*�*�*�*�*�*�*��)�������"�"�"�"�"�"�(�(�(�(�(�(��6�
����������R�R�R�R�R��R�R�R�j`4�`4�`4�`4�`4�9�`4�`4�`4�`4�`4r

Zerion Mini Shell 1.0