o
    ï¯ªgö
  ã                   @   s‚   d Z dgZddlZddlmZ ddlmZ ddlmZm	Z	m
Z
mZmZ ddlmZ er7dd	lmZ dd
lmZ G dd„ deƒZdS )zHModule implementing a remote object allowing easy access to git remotes.ÚRemoteReferenceé    N)Ú	join_pathé   )ÚHead)ÚAnyÚIteratorÚNoReturnÚTYPE_CHECKINGÚUnion)ÚPathLike)ÚRemote)ÚRepoc                       s’   e Zd ZdZejZe		ddddee	df ded de
d	e
d
ed  f‡ fdd„ƒZedddd d	e
d
dfdd„ƒZede
d	e
d
efdd„ƒZ‡  ZS )r   z&A reference pointing to a remote head.NÚrepor   Úcommon_pathÚremote)r   NÚargsÚkwargsÚreturnc                    s.   |p| j }|durt|t|ƒƒ}tƒ  ||¡S )zLIterate remote references, and if given, constrain them to the given remote.N)Ú_common_path_defaultr   ÚstrÚsuperÚ
iter_items)Úclsr   r   r   r   r   ©Ú	__class__© úK/var/www/html/chatdoc2/venv/lib/python3.10/site-packages/git/refs/remote.pyr       s   

zRemoteReference.iter_itemsÚrefsc              	   O   s‚   |j jddg|¢R Ž  |D ]1}zt tj |j|j¡¡ W n	 ty&   Y nw zt tj |j|j¡¡ W q ty>   Y qw dS )z»Delete the given remote references.

        :note:
            `kwargs` are given for comparability with the base class method as we
            should not narrow the signature.
        z-dz-rN)	ÚgitÚbranchÚosÚremoveÚpathÚjoinÚ
common_dirÚOSErrorÚgit_dir)r   r   r   r   Úrefr   r   r   Údelete5   s   ÿÿùzRemoteReference.deletec                 O   s   t dƒ‚)zERaise :exc:`TypeError`. Defined so the ``create`` method is disabled.z*Cannot explicitly create remote references)Ú	TypeError)r   r   r   r   r   r   ÚcreateL   s   zRemoteReference.create)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Ú_remote_common_path_defaultr   Úclassmethodr
   r   r   r   r   r(   r   r*   Ú__classcell__r   r   r   r   r      s.    üþ
ýüûúù )r.   Ú__all__r    Úgit.utilr   Úheadr   Útypingr   r   r   r	   r
   Ú	git.typesr   Ú
git.remoter   Úgit.repor   r   r   r   r   r   Ú<module>   s   