AlkantarClanX12

Your IP : 3.142.131.51


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

�

�܋f
�����ddlZddlZddlmZmZddlmZmZddlm	Z	ddl
mZmZm
Z
mZmZddl
mZddlmZmZmZddlmZmZmZmZmZdd	lmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$m%Z%m&Z&m'Z'm(Z(dd
l)m*Z*m+Z+m,Z,e$rddl-m.Z.ddl/m0Z0e+d
Z1ej2d��Z3e3�4ej5����dZ6dedede&ededefdfdefd�Z7e(dddefd���Z8e(dedefdefd���Z8e(dedefd���Z8de&edefedfde&eeffd�Z8Gd�dee9��Z:Gd�de
e:��Z;Gd�d ee9��Z<Gd!�d"ee��Z=dS)#�N)�handle_process_output�Git)�defenc�
force_text)�GitCommandError)�	LazyMixin�IterableObj�IterableList�RemoteProgress�CallableRemoteProgress)�	join_path)�GitConfigParser�SectionConstraint�cp)�Head�	Reference�RemoteReference�SymbolicReference�TagReference)
�Any�Callable�Dict�Iterator�List�NoReturn�Optional�Sequence�
TYPE_CHECKING�Type�Union�cast�overload)�PathLike�Literal�
Commit_ish)�Repo)�UpdateProgress)� �!�+�-�*�=�t�?z
git.remote)r�PushInfo�	FetchInfo�Remote�kwargs�git�progressr'.�returnc�>�|�|jdd�}|dkrd|d<|S)z�Add the --progress flag to the given kwargs dict if supported by the
    git command. If the actual progress in the given progress instance is not
    given, we do not request any progress
    :return: possibly altered kwargsN�)��Tr5)�version_info)r3r4r5�vs    �[/builddir/build/BUILD/cloudlinux-venv-1.0.6/venv/lib/python3.11/site-packages/git/remote.py�add_progressr>Ms5������R�a�R� ����;�;�!%�F�:���M�c��dS�N��r5s r=�to_progress_instancerDb����Cr?c��dSrArBrCs r=rDrDgrEr?c��dSrArBrCs r=rDrDlrEr?c�b�t|��rt|��S|�t��S|S)zUGiven the 'progress' return a suitable object derived from
    RemoteProgress().
    )�callablerrrCs r=rDrDqs=������ �%�h�/�/�/�
�	������Or?c�^�eZdZdZdZdZd�ed��D��\ZZZ	Z
ZZZ
ZZZZe	e
deeeed�Z		dd
edeedfded
ddeededdfd�Zedeeeedffd���Zedeeeffd���Zed
ddeddfd���Z eddde!de!de"fd���Z#dS)r0ah
    Carries information about the result of a push operation of a single head::

        info = remote.push()[0]
        info.flags          # bitflags providing more information about the result
        info.local_ref      # Reference pointing to the local reference that was pushed
                            # It is None if the ref was deleted.
        info.remote_ref_string # path to the remote reference located on the remote side
        info.remote_ref # Remote Reference on the local side corresponding to
                        # the remote_ref_string. It can be a TagReference as well.
        info.old_commit # commit at which the remote_ref was standing before we pushed
                        # it to local_ref.commit. Will be None if an error was indicated
        info.summary    # summary line providing human readable english text about the push
    )�	local_ref�remote_ref_string�flags�_old_commit_sha�_remote�summary�pushinfoc��g|]}d|z��S�r9rB��.0�xs  r=�
<listcomp>zPushInfo.<listcomp>�s��#�#�#�A��a��#�#�#r?�r)�Xr+r,r*r(r-r)N�rMrKrL�remoter2�
old_commitrPr6c�Z�||_||_||_||_||_||_dS)z�Initialize a new instance
        local_ref: HEAD | Head | RemoteReference | TagReference | Reference | SymbolicReference | NoneN)rMrKrLrOrNrP)�selfrMrKrLr[r\rPs       r=�__init__zPushInfo.__init__�s4����
�"���!2������)�������r?c�\�|jr$|jj�|j��pdSrA)rNrO�repo�commit�r^s r=r\zPushInfo.old_commit�s,���#�V���(9�(@�(@��AU�(V�(V�^�Z^�^r?c��|j�d��rt|jj|j��S|j�d��rVt|jj|j��}t
|jjdt|j���d|j����Std|jz���)z�
        :return:
            Remote Reference or TagReference in the local repository corresponding
            to the remote_ref_string kept in this instance.z	refs/tagsz
refs/headsz
refs/remotes/�/zCould not handle remote ref: %r)
rL�
startswithrrOrarr�str�name�
ValueError)r^�
remote_refs  r=rjzPushInfo.remote_ref�s����!�,�,�[�9�9�		Y���� 1�4�3I�J�J�J�
�
#�
.�
.�|�
<�
<�	Y�"�4�<�#4�d�6L�M�M�J�"���!�!�(+�D�L�(9�(9�(9�(9�:�?�?�K���
�
�>��AW�W�X�X�Xr?�linec���|�dd��\}}}d}	||j|z}n(#t$r}td|�d|����|�d}~wwxYw|�d��\}}	||jzrd}
n#|dkrd}
ntj|j|��}
d}|�d	��rZd
|vr||j	z}n�d|vr||j
z}nyd|vr||jz}njd
|vr||jz}n[d|vr||j
z}nLd|vr
||jz}n=d}|dkrd}|�d��d�|��\}
}|
}t||
|	|||��S)z�Create a new PushInfo instance as parsed from line which is expected to be like
        refs/heads/master:refs/heads/master 05d2687..1d0568e as bytes�	�r�Control character � unknown as parsed from line N�:z(delete)�[z
[rejected]z[remote rejected]z[remote failure]z
[no match]z	[new tag]z[new branch]�...r(�..)�split�	_flag_map�KeyErrorri�DELETEDr�	from_pathrarf�REJECTED�REMOTE_REJECTED�REMOTE_FAILURE�ERROR�NEW_TAG�NEW_HEADr0)�clsr[rk�control_character�from_torPrM�e�from_ref_string�
to_ref_string�from_refr\�split_token�old_sha�_new_shas               r=�
_from_linezPushInfo._from_line�s���/3�j�j��q�.A�.A�+��7�G���	w��S�]�#4�5�5�E�E���	w�	w�	w��*�Vg�Vg�Vg�im�im�n�o�o�uv�v�����	w����
*1���s�);�);�&����3�;��	M�7;�H�H��*�,�,����$�.�v�{�O�L�L��%)�
����c�"�"�	!��w�&�&����%���$��/�/���,�,���#�w�.�.���+�+�����(�(����"�����'�'����$����7�*�*����%���
 �K� �C�'�'�"�� '�
�
�c� 2� 2�1� 5� ;� ;�K� H� H��G�X� �J���x���
�G�T�T�Ts�/�
A�A�Arar&�argsr3c��t�rA��NotImplementedError�r�rar�r3s    r=�
iter_itemszPushInfo.iter_items���!�!r?)NrZ)$�__name__�
__module__�__qualname__�__doc__�	__slots__�_id_attribute_�ranger~r�NO_MATCHrzr{r|rx�
FORCED_UPDATE�FAST_FORWARD�
UP_TO_DATEr}rv�intr rrgrr_�propertyr%r\rrrj�classmethodr�rrr�rBr?r=r0r0�s�������
�
��I� �N�	$�#���r���#�#�#������������
��
�
�
�
�
�
���I� %)�������*�D�0�1���	�
���S�M�
���
�����$�_�E�#�'8�*�d�"J�K�_�_�_��X�_��Y�E�/�<�"?�@�Y�Y�Y��X�Y�$�2U��2U��2U�
�2U�2U�2U��[�2U�h�"�f�"�S�"�C�"�H�"�"�"��[�"�"�"r?r0c�4��eZdZdZdd�Zd�fd�Zdd�Z�xZS)	�PushInfoListz+
    IterableList of PushInfo objects.
    r6c�R�tttj|d����S�N�
push_infos)r!r�r
�__new__�r�s r=r�zPushInfoList.__new__s���L�,�"6�s�L�"I�"I�J�J�Jr?Nc�X��t���d��d|_dSr�)�superr_�error)r^�	__class__s �r=r_zPushInfoList.__init__ s&���
������&�&�&�*.��
�
�
r?c�"�|jr|j�dS)z?
        Raise an exception if any ref failed to push.
        N)r�rcs r=�raise_if_errorzPushInfoList.raise_if_error$s ���:�	��*��	�	r?)r6r��r6N)r�r�r�r�r�r_r��
__classcell__�r�s@r=r�r�ss���������K�K�K�K�/�/�/�/�/�/��������r?r�c
��eZdZUdZdZdZd�ed��D��\ZZZ	Z
ZZZ
Zejd��Zeede	e
e
d�Zeeefed	<ed
edfd���Z			d dedededeedfdeed
dfd�Z d
efd�Z!e"d
efd���Z#e"d
efd���Z$edddeded
dfd���Z%eddde&de&d
e'fd���Z(dS)!r1a*
    Carries information about the results of a fetch operation of a single head::

     info = remote.fetch()[0]
     info.ref           # Symbolic Reference or RemoteReference to the changed
                        # remote head or FETCH_HEAD
     info.flags         # additional flags to be & with enumeration members,
                        # i.e. info.flags & info.REJECTED
                        # is 0 if ref is SymbolicReference
     info.note          # additional notes given by git-fetch intended for the user
     info.old_commit    # if info.flags & info.FORCED_UPDATE|info.FAST_FORWARD,
                        # field is set to the previous location of ref, otherwise None
     info.remote_ref_path # The path from which we fetched on the remote. It's the remote's version of our info.ref
    )�refr\rM�note�remote_ref_path�	fetchinfoc��g|]}d|z��SrSrBrTs  r=rWzFetchInfo.<listcomp>Is��"�"�"�A��a��"�"�"r?�zE^\s*(.) (\[[\w\s\.$@]+\]|[\w\.$@]+)\s+(.+) -> ([^\s]+)(    \(.*\)?$)?r)r)r*r,r-r(r+rvr6Tc���	|jd=n#t$rYnwxYw	|jd=n#t$rYnwxYwt��jdd�dkr|j|jd<n|j|jd<dS)zWThis gets called by the refresh function (see the top level
        __init__).
        r.r+Nr8)r8�
T)rvrwrr;�
TAG_UPDATEr�s r=�refreshzFetchInfo.refreshVs���	��
�c�"�"���	�	�	��D�	����	��
�c�"�"���	�	�	��D�	�����5�5��b�q�b�!�W�,�,�!$��C�M�#���!$��C�M�#���ts��
��%�
2�2rZNr�rMr�r\r�c�L�||_||_||_||_||_dS)z+
        Initialize a new instance
        N)r�rMr�r\r�)r^r�rMr�r\r�s      r=r_zFetchInfo.__init__ns.�������
���	�$���.����r?c��|jSrA�rhrcs r=�__str__zFetchInfo.__str__�
���y�r?c��|jjS)z:return: Name of our remote ref)r�rhrcs r=rhzFetchInfo.name�s���x�}�r?c��|jjS)z!:return: Commit of our remote ref)r�rbrcs r=rbzFetchInfo.commit�s���x��r?rar&rk�
fetch_linec�t�|j�|��}|�td|z���|���\}}}}}	t	t
|��}	|�d��\}
}}|�dd��\}
}n%#t$r}td|z��|�d}~wwxYwd}	||j|z}n(#t$r}td|�d	|����|�d}~wwxYwd}d
}d|vr
||j	z}d|vr||j
z}d
}d|vr||jz}d
}d|vr
||jz}d|vsd|vr@d}|dkr
|dd�}|�
|�|��d��}d}|dkrt}n:|
dks|rt}n*|
dvrt }nd|
vrt"}nt%d|
z���|tur
||d��}n�d}|���}|�t*jdz��r5|}|tur)|�t jdz��st*}n=|turd|vrt/t j|��}nt/|j|��}|||d
���}|	r|	���pd}	||||	||��S)a�Parse information from the given line as returned by git-fetch -v
        and return a new FetchInfo object representing this information.

        We can handle a line as follows:
        "%c %-\*s %-\*s -> %s%s"

        Where c is either ' ', !, +, -, \*, or =
        ! means error
        + means success forcing update
        - means a tag was updated
        * means birth of new branch or tag
        = means the head was up to date ( and not moved )
        ' ' means a fast-forward

        fetch line is the corresponding line from FETCH_HEAD, like
        acb0fa8b94ef421ad60c8507b634759a472cd56c    not-for-merge   branch '0.1.7RC' of /tmp/tmpya0vairemote_repoNzFailed to parse line: %rrmr(r9z#Failed to parse FETCH_HEAD line: %rrrorpF�rejectedznew tagTz
tag updatez
new branchrsrt����
FETCH_HEAD�tag)zremote-tracking�branchrez Cannot handle reference type: %rztags/)�
check_pathrZ)�_re_fetch_result�matchri�groupsr!�flagKeyLiteralrurvrwrzr~r�r�	rev_parserrrr�	TypeError�striprfr�_common_path_defaultr
)r�rarkr�r�r��	operation�local_remote_ref�remote_local_ref_strr��_new_hex_sha�_fetch_operation�
fetch_note�
ref_type_namer�rMr\�is_tag_operationr��ref_type�remote_local_ref�ref_paths                      r=r�zFetchInfo._from_line�s���$�$�*�*�4�0�0���=��7�$�>�?�?�?�
�L�L�N�N�
	
���� ��!��1B�C�C��	X�9C�9I�9I�$�9O�9O�6�L�*�J�(2�(8�(8��a�(@�(@�%�M�:�:���	X�	X�	X��B�Z�O�P�P�VW�W�����	X������	w��S�]�#4�5�5�E�E���	w�	w�	w��*�Vg�Vg�Vg�im�im�n�o�o�uv�v�����	w����
/3�
� ����"�"��S�\�!�E��	�!�!��S�[� �E�#���9�$�$��S�^�#�E�#���9�$�$��S�\�!�E��I�����!2�!2��K� �C�'�'�)�#�2�#�.�����	����(D�(D�Q�(G�H�H�J�7;���<�/�/�(�H�H�
�e�
#�
#�'7�
#�$�H�H�
�;�
;�
;�'�H�H�
�M�
!�
!��H�H��>��N�O�O�O��(�(�(�'�x��l�;�;���,0�H�#7�#=�#=�#?�#?� �#�.�.�y�/M�PS�/S�T�T�

Z�0���<�/�/�8L�8W�8W�#�8�3�>�9�9�/� )�H���\�)�)�g�9M�.M�.M�$�_�%I�K_�`�`���$�X�%B�DX�Y�Y��
 (�x��h�5�I�I�I���%������,�"���s�#�U�D�*�>N�O�O�Os0�2B�
B4�B/�/B4�:C�
C0�C+�+C0r�r3c��t�rAr�r�s    r=r�zFetchInfo.iter_itemsr�r?)rZNN))r�r�r�r�r�r�r�r~r�
HEAD_UPTODATEr�rzr�r�r}�re�compiler�rvrr�r��__annotations__r�r$r�rrgr r%rr#r_r�r�rhrbr�rrr�rBr?r=r1r1,s?�������
�
�J�I� �N�	#�"���q���"�"�"�	��������
�"�r�z�"j�k�k���
�
�
�
�
�
,�,�I�t�N�C�'�(��������
�����[��6�.2�.2�
/�/�
�/��/��	/�
�*�d�*�+�/�"�(�+�
/�
�/�/�/�/�"��������c�����X����
�����X���}P�f�}P�C�}P�S�}P�[�}P�}P�}P��[�}P�~�"�f�"�S�"�C�"�H�"�"�"��[�"�"�"r?r1c����eZdZdZdZdZdgZdgZddgZddde	d	d
fd�Z
de	d	ef�fd
�Zd	e	fd�Z
de	d	d
f�fd�Zd	e	fd�Zd	e	fd�Zded	efd�Zded	efd�Zd	efd�Zd	efd�Zedddeded	edfd���Z	d?de	dee	deded	df
d�Zd@de	deded	dfd �Zde	ded	dfd!�Zed	ee	fd"���Z ed	e!e"fd#���Z#ed	e!e$fd$���Z%ed@ddde	de	deded	dfd%���Z&eddde	de	ded	df
d&���Z'eddde	d	e	fd'���Z(e(Z)d(e	d	dfd)�Z*ded	dfd*�Z+	dAd+d,d-e,e-d.efe.d
fd/e,d
e/fd	e!d0fd1�Z0	dAd+d,d-e,e-d.efe.d
fd/e,d
e/fd	e1fd2�Z2dBd3�Z3						dCd5e,e	e4e	d
fd-e,e.d
d6fd7ed/e,d
e/fded8eded	e!e5fd9�Z6					dDd5e,e	e4e	d
fd-e,e.d6d
fd/e,d
e/fded8eded	e!e5fd:�Z7					dDd5e,e	e4e	d
fd-e,e.d6e-d.e.fd
fd/e,d
e/fded8eded	e1fd;�Z8ed	e9e:fd<���Z;dBd=�Z<ed	e9fd>���Z=�xZ>S)Er2aHProvides easy read and write access to a git remote.

    Everything not part of this interface is considered an option for the current
    remote, allowing constructs like remote.pushurl to query the pushurl.

    NOTE: When querying configuration, the configuration accessor will be cached
    to speed up subsequent accesses.)rarh�_config_readerrhz
--upload-packz--receive-packz--execrar&r6Nc�&�||_||_|dS)z�Initialize a remote instance

        :param repo: The repository we are a remote of
        :param name: the name of the remote, i.e. 'origin'N)rarh)r^rarhs   r=r_zRemote.__init__/s��
��	���	��
�
�
r?�attrc���|dkr(tt|���|��S	|j�|��S#t
j$r+tt|���|��cYSwxYw)zrAllows to call this instance like
        remote.special( \*args, \*\*kwargs) to call git-remote special self.namer�)r�r2�__getattr__r��getr�
NoOptionError�r^r�r�s  �r=r�zRemote.__getattr__8s�����#�#�#����&�&�2�2�4�8�8�8�	9��&�*�*�4�0�0�0����	9�	9�	9����&�&�2�2�4�8�8�8�8�8�	9���s�A�7B�Bc��d|jzS)Nzremote "%s"r�rcs r=�_config_section_namezRemote._config_section_nameFs���t�y�(�(r?c����|dkrAt|j�d��|�����|_dStt|���|��dS)Nr��
repository)rra�
config_readerr�r�r�r2�_set_cache_r�s  �r=r�zRemote._set_cache_Isj����#�#�#�#4�D�I�4K�4K�L�4Y�4Y�[_�[t�[t�[v�[v�"w�"w�D�����&�$���+�+�D�1�1�1�1�1r?c��|jSrAr�rcs r=r�zRemote.__str__Qr�r?c�2�d|jj�d|j�d�S)Nz<git.z "z">)r�r�rhrcs r=�__repr__zRemote.__repr__Ts ���"&�.�"9�"9�"9�4�9�9�9�E�Er?�otherc�\�t|t|����o|j|jkSrA)�
isinstance�typerh�r^r�s  r=�__eq__z
Remote.__eq__Ws&���%��d���,�,�H���e�j�1H�Hr?c��||kSrArBr�s  r=�__ne__z
Remote.__ne__Zs���E�M�"�"r?c�*�t|j��SrA)�hashrhrcs r=�__hash__zRemote.__hash__]s���D�I���r?c��	|j�d��dS#tj$rYdStj$rYdSwxYw)z�
        :return: True if this is a valid, existing remote.
            Valid remotes have an entry in the repository's configuration�urlTF)r�r�rr��NoSectionErrorrcs r=�existsz
Remote.exists`sd��	���"�"�5�)�)�)��4����	�	�	��4�4�� �	�	�	��5�5�	���s��A�A�Ar�r3c/�TK�|�d�����D]}}|�d��s�|�d��}|�d��}|dks|dkrtd|z���t
|||dz|���V��~dS)zA:return: Iterator yielding Remote objects of the given repositoryr�zremote �"r�z%Remote-Section has invalid format: %rr9N)r��sectionsrf�find�rfindrir2)r�rar�r3�section�lbound�rbounds       r=r�zRemote.iter_itemsns������)�)�,�7�7�@�@�B�B�	=�	=�G��%�%�i�0�0�
���\�\�#�&�&�F��]�]�3�'�'�F���|�|�v��|�|� �!H�7�!R�S�S�S���w�v��z�F�':�;�<�<�<�<�<�<�	=�	=r?F�new_url�old_url�allow_unsafe_protocolsc���|stj|��d}||d<|r"|jjj|d|j||fi|��n |jjj|d|j|fi|��|S)a�Configure URLs on current remote (cf command git remote set_url)

        This command manages URLs on the remote.

        :param new_url: string being the URL to add as an extra remote URL
        :param old_url: when set, replaces this URL with new_url for the remote
        :param allow_unsafe_protocols: Allow unsafe protocols to be used, like ext
        :return: self
        zset-url�insert_kwargs_after�--)r�check_unsafe_protocolsrar4r[rh)r^rrr
r3�scmds      r=�set_urlzRemote.set_url{s���&�	0��&�w�/�/�/���(,��$�%��	K� �D�I�M� ��t�T�Y���S�S�F�S�S�S�S� �D�I�M� ��t�T�Y��J�J�6�J�J�J��r?rc�2�|�|d|���S)a|Adds a new url on current remote (special case of git remote set_url)

        This command adds new URLs to a given remote, making it possible to have
        multiple URLs for a single remote.

        :param url: string being the URL to add as an extra remote URL
        :param allow_unsafe_protocols: Allow unsafe protocols to be used, like ext
        :return: self
        T)�addr
�r)r^rr
r3s    r=�add_urlzRemote.add_url�s���|�|�C�T�BX�|�Y�Y�Yr?c�0�|�|d���S)a+Deletes a new url on current remote (special case of git remote set_url)

        This command deletes new URLs to a given remote, making it possible to have
        multiple URLs for a single remote.

        :param url: string being the URL to delete from the remote
        :return: self
        T)�deleter)r^rr3s   r=�
delete_urlzRemote.delete_url�s���|�|�C��|�-�-�-r?c#�4�K�	|jj�dd|j��}t	|t
��sJ�|�d��D]}|V��d
S#t$�r,}dt|��v�r	|jj�d|j��}t	|t
��sJ�|�d��D]#}d|vr|�d��dV��$n�#t$r��t�fd	�d
D����r\|jj�	dd|jz��}t	|t
��sJ�|�d��D]}|V��n��Yd
��nd
��wwxYw|�Yd
}~d
SYd
}~d
Sd
}~wwxYw)zL:return: Iterator yielding all configured URL targets on a remote as stringszget-urlz--all�
zUnknown subcommand: get-url�showz  Push  URL:z: r�c3�:�K�|]}|t���vV��dSrA)rg)rU�msg�_exs  �r=�	<genexpr>zRemote.urls.<locals>.<genexpr>�s-�����b�b�s�3�#�c�(�(�?�b�b�b�b�b�br?)zcorrect access rightszcannot run sshz	--get-allz
remote.%s.urlN)
rar4r[rhr�rgrur�any�config)r^�remote_detailsrk�exr s    @r=�urlszRemote.urls�s3�����	�!�Y�]�1�1�)�W�d�i�P�P�N��n�c�2�2�2�2�2�&�,�,�T�2�2�
�
���
�
�
�
�
�
���	�	�	�-��B���7�7�"�%)�Y�]�%9�%9�&�$�)�%L�%L�N�%�n�c�:�:�:�:�:� .� 4� 4�T� :� :�7�7��)�T�1�1�"&�*�*�T�"2�"2�2�"6�6�6�6��7��'�"�"�"��b�b�b�b�6a�b�b�b�b�b�"�)-���)=�)=�k�?�]a�]f�Kf�)g�)g��)�.�#�>�>�>�>�>�$2�$8�$8��$>�$>�'�'�D�"&�J�J�J�J�'�"�	�'�'�'�'�'�����"������7�7�7�7�7�7�'�'�'�'�'�'�����%	���sD�AA � F�+F�>A5C4�3F�4
F�>A9E<�7F�<F�F�Fc��ttjd|jz��}|�tj|j|j�����|S)z�
        :return:
            IterableList of RemoteReference objects. It is prefixed, allowing
            you to omit the remote path portion, i.e.::
            remote.refs.master # yields RemoteReference('/refs/remotes/origin/master')�%s/)r[)r
rr�rh�extend�
list_itemsra)r^�out_refss  r=�refszRemote.refs�sK��3?��?]�_d�gk�gp�_p�2q�2q������2�4�9�T�Y�O�O�O�P�P�P��r?c�4�ttjd|jz��}|jj�dd|�����dd�D]�}d}|�|��s�|�	|d��}|�tjdz��r.|�tj
|j|������tj�d|��}|�t|j|������|S)	a�
        :return:
            IterableList RemoteReference objects that do not have a corresponding
            head in the remote reference anymore as they have been deleted on the
            remote side, but are still available locally.

            The IterableList is prefixed, hence the 'origin' must be omitted. See
            'refs' property for an example.

            To make things more complicated, it can be possible for the list to include
            other kinds of references, for example, tag references, if these are stale
            as well. This is a fix for the issue described here:
            https://github.com/gitpython-developers/GitPython/issues/260
        r(�prunez	--dry-runr8Nz * [would prune] rZre)r
rr�rhrar4r[�
splitlinesrf�replacerr��appendry)r^r+rk�token�ref_name�fqhns      r=�
stale_refszRemote.stale_refs�s�� -9��9W�Y^�ae�aj�Yj�,k�,k���I�M�(�(��+�t�D�D�O�O�Q�Q�RS�RT�RT�U�	B�	B�D�(�E��?�?�5�)�)�
���|�|�E�2�.�.�H��"�"�9�#A�C�#G�H�H�
B����	� 3�D�I�x� H� H�I�I�I�I�"1�"F�"F�"F���Q�������	�4� @� @�A�A�A�A��r?c��d}||d<tj|��}|stj|��|jj|d||fi|��|||��S)aCreate a new remote to the given repository

        :param repo: Repository instance that is to receive the new remote
        :param name: Desired name of the remote
        :param url: URL which corresponds to the remote's name
        :param allow_unsafe_protocols: Allow unsafe protocols to be used, like ext
        :param kwargs: Additional arguments to be passed to the git-remote add command
        :return: New Remote instance
        :raise GitCommandError: in case an origin with that name already existsrrr)r�
polish_urlrr4r[)r�rarhrr
r3rs       r=�createz
Remote.create�sn����(,��$�%��n�S�!�!��%�	,��&�s�+�+�+������d�D�#�8�8��8�8�8��s�4����r?c�"�|j|||fi|��SrA)r8)r�rarhrr3s     r=rz
Remote.add
s ���s�z�$��c�4�4�V�4�4�4r?c��|j�d|��t||��r|���|S)zaRemove the remote with the given name

        :return: the passed remote name to remove
        �rm)r4r[r��_clear_cache)r�rarhs   r=�removez
Remote.removesC��	
�����d�#�#�#��d�C� � �	 ��������r?�new_namec��|j|kr|S|jj�d|j|��||_|���|S)z8Rename self to the given new_name

        :return: self�rename)rhrar4r[r<)r^r>s  r=r@z
Remote.renamesR���9�� � ��K��	�
���X�t�y�(�;�;�;���	��������r?c�P�d}||d<|jjj||jfi|��|S)a(Fetch all changes for this remote, including new branches which will
        be forced in ( in case your local remote branch is not part the new remote branches
        ancestry anymore ).

        :param kwargs:
            Additional arguments passed to git-remote update

        :return: self�updater)rar4r[rh)r^r3rs   r=rBz
Remote.update)s<����(,��$�%���	�
��T�4�9�7�7��7�7�7��r?�proczGit.AutoInterruptr5.�kill_after_timeoutr1c�8�t|��}td��}g}ttj�����}|���}t|d|dd|���|jrd�	|j��pd}|�
|���|rt�d|��|j
D]W}	t|	��}	|D]C}
t|	��dkr.|	d	d
kr"|	d|
kr|�|	���C�D�Xt#|jd��}t'|jd��5}d
�|���D��}
ddd��n#1swxYwYt|��}t|
��}||kr�d}|dz
}|dz
}|||fz}t�|��t�dt/|���d��z��t�dt/|
���d��z��||kr|
d|�}
n
|d|�}t3||
��D]�\}}	|�t�|j||�����;#t6$rR}t�d|��t�d|�����Yd}~��d}~wwxYw|S)NrhF��	finalizer�decode_streamsrDrrZ��stderr�'Error lines received while fetching: %sr9rr(r��rbc�B�g|]}|�t����SrB)�decoder)rUrks  r=rWz6Remote._get_fetch_info_from_stderr.<locals>.<listcomp>ds$��N�N�N�t�t�{�{�6�2�2�N�N�Nr?zFFetch head lines do not match lines provided via progress information
zKlength of progress lines %i should be equal to lines in FETCH_HEAD file %i
z5Will ignore extra progress lines or fetch head lines.sinfo lines: zUTF-8shead info: z#Caught error while parsing line: %szGit informed while fetching: %s)rDr
�setr1rv�keys�new_message_handlerr�error_lines�join�wait�log�warning�other_linesr�lenr1rra�open�abspath�	readlines�debugrg�encode�zipr�rir�)r^rCr5rD�output�fetch_info_lines�cmds�progress_handler�stderr_textrk�cmd�
fetch_head�fp�fetch_head_info�l_fil�l_fhir�err_liner��excs                    r=�_get_fetch_info_from_stderrz"Remote._get_fetch_info_from_stderr7s���(��1�1��-9��,@�,@��
���9�&�+�+�-�-�.�.��#�7�7�9�9������� �1�
	
�	
�	
�	
��*�N�t�y�y��9M�/N�/N�T�RT���	�	��	�%�%�%��	P��K�K�A�;�O�O�O��(�	�	�D��d�#�#�D��
�
���t�9�9�q�=�=�T�!�W��^�^��Q��3���$�+�+�D�1�1�1���
�'�t�y�,�?�?�
�
�*�$�d�
+�
+�	O�r�N�N�r�|�|�~�~�N�N�N�O�	O�	O�	O�	O�	O�	O�	O�	O�	O�	O�	O����	O�	O�	O�	O��$�%�%���O�$�$���E�>�>�[�C��a�a�C��J�J�C��E�5�>�!�C��I�I�c�N�N�N��I�I�o��,<�(=�(=�(D�(D�W�(M�(M�M�N�N�N��I�I�n�s�?�';�';�'B�'B�7�'K�'K�K�L�L�L��u�}�}�"1�&�5�&�"9���#3�F�U�F�#;� �%(�(8�/�$J�$J�	Q�	Q� �H�j�
Q��
�
�i�2�2�4�9�h�
�S�S�T�T�T�T���
Q�
Q�
Q��	�	�?��E�E�E����=�x�~�~�?O�?O�P�P�P�P�P�P�P�P�����
Q�����
s+�E?�?F�F�4J;�;
L�AL�Lc����t|��}|���}t���dtddf��fd�}t	|||dd|���|jrd�|j��pd}	|�|���n>#t$r1}�s�|r"t�
d	|��|�_Yd}~nd}~wwxYw�S)
Nrkr6c���	��t��|����dS#t$rYdSwxYwrA)r1r0r�ri)rkr_r^s ��r=�stdout_handlerz-Remote._get_push_info.<locals>.stdout_handler�sR���
��
�
�h�1�1�$��=�=�>�>�>�>�>���
�
�
����
���s�.3�
A�AFrFrrZrIrK)rDrQr�rgrrRrSrT�	ExceptionrUrVr�)	r^rCr5rDrbrorcr�r_s	`       @r=�_get_push_infozRemote._get_push_infos(����(��1�1��$�7�7�9�9��+�~�~��	��	��	�	�	�	�	�	�	�	����� �1�
	
�	
�	
�	
��*�N�t�y�y��9M�/N�/N�T�RT��		!��I�I�[�I�)�)�)�)���	!�	!�	!��
!���
!����E�{�S�S�S� ������������	!�����
s�=B�
C�'C
�
Cc��|j}d}	|�d|���|ur*d}|dz
}|dz
}t||j|jfz���	|���dS#|���wxYw)z>Turns out we can't deal with remotes if the refspec is missing�placeholder�fetch)�defaultz Remote '%s' has no refspec set.
zYou can set it as follows:zA 'git config --add "remote.%s.fetch +refs/heads/*:refs/heads/*"'.N)r��	get_value�AssertionErrorrh�release)r^r#�unsetrs    r=�_assert_refspeczRemote._assert_refspec�s����#����	�������7�7�5�@�@�9���3�3���\�\��$�S�D�I�t�y�+A�%A�B�B�B�	A�
�N�N�������F�N�N�������s�AA%�%A;T�refspecr'�verbose�allow_unsafe_optionsc�2�|�|���t||jj|��}t	|t
��r|}n|g}|s|D]}	|	rt
j|	���|s:t
jt|�	����|j
���|jjjd|g|�Rddd|d�|��}
|�|
||���}t|jjd��r|jj���|S)	a�Fetch the latest changes for this remote

        :param refspec:
            A "refspec" is used by fetch and push to describe the mapping
            between remote ref and local ref. They are combined with a colon in
            the format <src>:<dst>, preceded by an optional plus sign, +.
            For example: git fetch $URL refs/heads/master:refs/heads/origin means
            "grab the master branch head from the $URL and store it as my origin
            branch head". And git push $URL refs/heads/master:refs/heads/to-upstream
            means "publish my master branch head as to-upstream branch at $URL".
            See also git-push(1).

            Taken from the git manual

            Fetch supports multiple refspecs (as the
            underlying git-fetch does) - supplying a list rather than a string
            for 'refspec' will make use of this facility.
        :param progress: See 'push' method
        :param verbose: Boolean for verbose output
        :param kill_after_timeout:
            To specify a timeout in seconds for the git command, after which the process
            should be killed. It is set to None by default.
        :param allow_unsafe_protocols: Allow unsafe protocols to be used, like ext
        :param allow_unsafe_options: Allow unsafe options to be used, like --upload-pack
        :param kwargs: Additional arguments to be passed to git-fetch
        :return:
            IterableList(FetchInfo, ...) list of FetchInfo instances providing detailed
            information about the fetch results

        :note:
            As fetch does not provide progress information to non-ttys, we cannot make
            it available here unfortunately as in the 'push' method.N��options�unsafe_optionsrTF)�
as_process�with_stdout�universal_newlinesr<�rD�update_cache)rzr>rar4r��listrr�check_unsafe_optionsrP�unsafe_git_fetch_optionsrtrl�hasattr�odbr�)r^r{r5r|rDr
r}r3r�r�rC�ress            r=rtzRemote.fetch�sJ��T�?�� � �"�"�"��f�d�i�m�X�>�>���g�t�$�$�	�,3�D�D��9�D�%�	4��
4�
4���4��.�s�3�3�3��#�	p��$�T�&�+�+�-�-�-@�-@�QU�Qn�o�o�o�o�"�t�y�}�"��$�
��
�
�*.�E�VZ�^e�
�
�io�
�
���.�.�t�X�Rd�.�e�e���4�9�=�.�1�1�	)��I�M�&�&�(�(�(��
r?c� �|�|���t||jj|��}t	j|pg��}|s|D]}t	j|���|s:t	jt|�	����|j
���|jjjd||fddddd�|��}|�|||���}	t|jjd��r|jj���|	S)	a<Pull changes from the given branch, being the same as a fetch followed
        by a merge of branch with your local branch.

        :param refspec: see :meth:`fetch` method
        :param progress: see :meth:`push` method
        :param kill_after_timeout: see :meth:`fetch` method
        :param allow_unsafe_protocols: Allow unsafe protocols to be used, like ext
        :param allow_unsafe_options: Allow unsafe options to be used, like --upload-pack
        :param kwargs: Additional arguments to be passed to git-pull
        :return: Please see :meth:`fetch` methodNrrFT)r�r�r�r<r�r�)rzr>rar4r�_unpack_argsrr�r�rP�unsafe_git_pull_options�pullrlr�r�r�)
r^r{r5rDr
r}r3r�rCr�s
          r=r�zRemote.pull�s,��&�?�� � �"�"�"��f�d�i�m�X�>�>���"�7�=�b�1�1��%�	0��
0�
0���*�3�/�/�/�/�#�	o��$�T�&�+�+�-�-�-@�-@�QU�Qm�n�n�n�n�!�t�y�}�!��$��
�-2�t�X\�`d�
�
�hn�
�
���.�.�t�X�Rd�.�e�e���4�9�=�.�1�1�	)��I�M�&�&�(�(�(��
r?c��t||jj|��}tj|pg��}|s|D]}tj|���|s:tjt|�����|j	���|jjj
d||fddd|d�|��}|�|||���S)aoPush changes from source branch in refspec to target branch in refspec.

        :param refspec: see 'fetch' method
        :param progress:
            Can take one of many value types:

            * None to discard progress information
            * A function (callable) that is called with the progress information.
              Signature: ``progress(op_code, cur_count, max_count=None, message='')``.
              `Click here <http://goo.gl/NPa7st>`__ for a description of all arguments
              given to the function.
            * An instance of a class derived from ``git.RemoteProgress`` that
              overrides the ``update()`` function.

        :note: No further progress information is returned after push returns.
        :param kill_after_timeout:
            To specify a timeout in seconds for the git command, after which the process
            should be killed. It is set to None by default.
        :param allow_unsafe_protocols: Allow unsafe protocols to be used, like ext
        :param allow_unsafe_options: Allow unsafe options to be used, like --receive-pack
        :param kwargs: Additional arguments to be passed to git-push
        :return:
            A ``PushInfoList`` object, where each list member
            represents an individual head which had been updated on the remote side.
            If the push contains rejected heads, these will have the PushInfo.ERROR bit set
            in their flags.
            If the operation fails completely, the length of the returned PushInfoList will
            be 0.
            Call ``.raise_if_error()`` on the returned object to raise on any failure.rrT)�	porcelainr�r�rDr�)r>rar4rr�rr�r�rP�unsafe_git_push_options�pushrq)	r^r{r5rDr
r}r3r�rCs	         r=r�zRemote.push$s���L�f�d�i�m�X�>�>���"�7�=�b�1�1��%�	0��
0�
0���*�3�/�/�/�/�#�	o��$�T�&�+�+�-�-�-@�-@�QU�Qm�n�n�n�n�!�t�y�}�!����	
���#�1�	
�	
��	
�	
���"�"�4��FX�"�Y�Y�Yr?c��|jS)z�
        :return:
            GitConfigParser compatible object able to read options for only our remote.
            Hence you may simple type config.get("pushurl") to obtain the information)r�rcs r=r�zRemote.config_reader`s
���"�"r?c�.�	|`dS#t$rYdSwxYwrA)r��AttributeErrorrcs r=r<zRemote._clear_cachehs5��	��#�#�#���	�	�	��D�D�	���s��
�c��|j���}|���t||�����S)a�
        :return: GitConfigParser compatible object able to write options for this remote.
        :note:
            You can only own one writer at a time - delete it to release the
            configuration file and make it usable by others.

            To assure consistent results, you should only query options through the
            writer. Once you are done writing, you are free to use the config reader
            once again.)ra�
config_writerr<rr�)r^�writers  r=r�zRemote.config_writerosG����(�(�*�*��	
������ ���)B�)B�)D�)D�E�E�Er?)NF)FrAr�)NNTNFF)NNNFF)?r�r�r�r�r�r�r�r�r�rgr_rr�r�r�r�r��object�boolr�r�r�r�rr�rr�rrrrr�r&r
rr,rr5r8rr=r;r@rBr rr�floatrlr�rqrzrr1rtr�r�rrr�r<r�r�r�s@r=r2r2s��������(�(�3�I��N�
	� ��	���	��	���V��3��4�����9��9��9�9�9�9�9�9�)�c�)�)�)�)�2��2��2�2�2�2�2�2�������F�#�F�F�F�F�I�F�I�t�I�I�I�I�#�F�#�t�#�#�#�#��#������������	=�f�	=�S�	=�C�	=�H�X�DV�	=�	=�	=��[�	=�[`�����%-�c�]��SW��kn��	�����,
Z�
Z�3�
Z��
Z�PS�
Z�X`�
Z�
Z�
Z�
Z�	.�c�	.�S�	.�X�	.�	.�	.�	.���h�s�m�����X��@��l�?�3�����X����L��3�����X��B���&����#��t��gj��ow�����[��&�5�v�5�S�5�s�5�c�5�h�5�5�5��[�5���&���������[��
�B��s��x������s��x�����$26�	F�F�!�F����c��*�N�D�@�A�F�"�$��+�.�	F�

�k�	"�F�F�F�F�X26�	*�*�!�*����c��*�N�D�@�A�*�"�$��+�.�	*�

�*�*�*�*�X����04�BF��15�',�%*�B�B��s�D��I�t�+�,�B����.>�>�?�B��	B�
"�$��+�.�B�!%�
B�#�B��B�
�i�	 �B�B�B�B�L04�BF�15�',�%*�
&�&��s�D��I�t�+�,�&���(8�$�>�?�&�"�$��+�.�	&�
!%�&�#�
&��&�
�i�	 �&�&�&�&�T04�ae�15�',�%*�
:Z�:Z��s�D��I�t�+�,�:Z���(8�(�3��CV�:W�Y]�]�^�:Z�"�$��+�.�	:Z�
!%�:Z�#�
:Z��:Z�
�:Z�:Z�:Z�:Z�x�#�0��A�#�#�#��X�#������F�0�F�F�F��X�F�F�F�F�Fr?r2)>�loggingr��git.cmdrr�
git.compatrr�git.excr�git.utilrr	r
rrr
�
git.configrrr�git.refsrrrrr�typingrrrrrrrrrrr r!r"�	git.typesr#r$r%�
git.repo.baser&�git.objects.submodule.baser'r��	getLoggerrU�
addHandler�NullHandler�__all__r>rDr�r0r�r1r2rBr?r=�<module>r�sT������	�	�	�	�.�.�.�.�.�.�.�.�)�)�)�)�)�)�)�)�#�#�#�#�#�#�������������������������������
W�V�V�V�V�V�V�V�V�V�V�V�V�V������������������������������� 4�3�3�3�3�3�3�3�3�3��:�"�"�"�"�"�"�9�9�9�9�9�9�
�?�@���g���%�%�����"�w�"�$�$�%�%�%�@��
���	���N�$4�h�s�N�?R�6S�UY�Y�Z��	�	����*
��4��N����
���
��8�C��H�#5��:P����
���
��>��n����
�����H�S�#�X�&���<�=��
�>�1�1�2�����$R"�R"�R"�R"�R"�{�F�R"�R"�R"�j�����<��)����(b"�b"�b"�b"�b"��V�b"�b"�b"�Jm	F�m	F�m	F�m	F�m	F�Y��m	F�m	F�m	F�m	F�m	Fr?