a
    `ºDfö
  ã                   @   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rnd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                	       sz   e Zd ZdZejZeddee	df ed e
e
ed  dœ‡ fdd„ƒZedd e
ddœd	d
„ƒZee
e
edœdd„ƒZ‡  ZS )r   z&A reference pointing to a remote head.Nr   )r   N)ÚrepoÚcommon_pathÚremoteÚ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__© ú\/nfs/NAS7/SABIOD/METHODE/ermites/ermites_venv/lib/python3.9/site-packages/git/refs/remote.pyr       s    

zRemoteReference.iter_items)r   Úrefsr   r   c              	   O   s„   |j jddg|¢R Ž  |D ]d}zt tj |j|j¡¡ W n tyL   Y n0 zt tj |j|j¡¡ W q ty|   Y q0 q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ÚjoinZ
common_dirÚOSErrorÚgit_dir)r   r   r   r   Úrefr   r   r   Údelete5   s    zRemoteReference.delete)r   r   r   c                 O   s   t dƒ‚dS )zERaise :exc:`TypeError`. Defined so the ``create`` method is disabled.z*Cannot explicitly create remote referencesN)Ú	TypeError)r   r   r   r   r   r   ÚcreateL   s    zRemoteReference.create)NN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__r   Z_remote_common_path_defaultr   Úclassmethodr
   r   r   r   r   r'   r   r)   Ú__classcell__r   r   r   r   r      s"     ü
ù)r-   Ú__all__r    Zgit.utilr   Úheadr   Útypingr   r   r   r	   r
   Z	git.typesr   Z
git.remoter   Zgit.repor   r   r   r   r   r   Ú<module>   s   