
    g
                         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rdd	lmZ dd
lmZ  G d de      Zy)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                        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       Zedddd d	e
d
dfd       Zede
d	e
d
efd       Z xZS )r   z&A reference pointing to a remote head.Nrepor   common_pathremote)r   Nargskwargsreturnc                 r    |xs | j                   }|t        |t        |            }t        |   ||      S )zLIterate remote references, and if given, constrain them to the given remote.)_common_path_defaultr   strsuper
iter_items)clsr   r   r   r   r   	__class__s         D/var/www/openai/venv/lib/python3.12/site-packages/git/refs/remote.pyr   zRemoteReference.iter_items    s?     "=S%=%=#KV=K w!$44    refsc                     |j                   j                  ddg|  |D ]  }	 t        j                  t        j                  j                  |j                  |j                               	 t        j                  t        j                  j                  |j                  |j                                y# t        $ r Y Vw xY w# t        $ r Y w xY w)zDelete 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   refs        r   deletezRemoteReference.delete5   s     	d*T* C		"'',,tAB		"'',,t||SXX>?     s%   AB7-AC7	CC	CCc                     t        d      )zERaise :exc:`TypeError`. Defined so the ``create`` method is disabled.z*Cannot explicitly create remote references)	TypeError)r   r   r   s      r   createzRemoteReference.createL   s     DEEr   )NN)__name__
__module____qualname____doc__r   _remote_common_path_defaultr   classmethodr   r   r   r   r   r+   r	   r.   __classcell__)r   s   @r   r   r      s    0;; .2(,	55 8T>*5 n%	5
 5 5 
#	$5 5( & ): c d  , F3 F# F( F Fr   )r2   __all__r#   git.utilr   headr   typingr   r   r	   r
   r   	git.typesr   
git.remoter   git.repor   r    r   r   <module>r>      s?    O
 	   A @ !
4Fd 4Fr   