
    .Ph                         d gZ ddlmZmZ ddlmZmZ ddlmZm	Z	m
Z
mZmZmZ ddlmZmZmZ erddlmZ de	d	ef         d
e	d	ef         fdZ G d d eee          ZdS )	Reference    )IterableObj	LazyMixin   )SymbolicReferenceT_References)AnyCallableIteratorTYPE_CHECKINGTypeUnion)AnyGitObjectPathLike_T)Repofunc.returnc                 V     dt           dt          dt          f fd} j        |_        |S )zZA decorator raising :exc:`ValueError` if we are not a valid remote, based on the
    path.selfargsr   c                 l    |                                  st          d| j        z             | g|R  S )Nz1ref path does not point to a remote reference: %s)	is_remote
ValueErrorpath)r   r   r   s     R/var/www/html/test/jupyter/venv/lib/python3.11/site-packages/git/refs/reference.pywrapperz(require_remote_ref_path.<locals>.wrapper   sF    ~~ 	^PSWS\\]]]tD 4        )r   r	   r   __name__)r   r   s   ` r   require_remote_ref_pathr       sG    !l !3 !2 ! ! ! ! ! ! }GNr   c                   `    e Zd ZdZdZdZdZdZdddded	e	d
df fdZ
d
efdZ	 ddeedef         deedf         d
d f fdZed
efd            Ze	 ddee         dddeedf         deded
ee         fd            Zeed
efd                        Zeed
efd                        Z xZS )r   zA named reference to any object.

    Subclasses may apply restrictions though, e.g., a :class:`~git.refs.head.Head` can
    only point to commits.
     FTrefsrepor   r   
check_pathr   Nc                     |rIt          |                              | j        dz             st          d| j        j        d|           |  t                                          ||           dS )a  Initialize this instance.

        :param repo:
            Our parent repository.

        :param path:
            Path relative to the ``.git/`` directory pointing to the ref in question,
            e.g. ``refs/heads/master``.

        :param check_path:
            If ``False``, you can provide any path.
            Otherwise the path must start with the default path prefix of this type.
        /zCannot instantiate z from path N)str
startswith_common_path_defaultr   	__class__r   super__init__)r   r$   r   r%   r+   s       r   r-   zReference.__init__6   s|      	ac$ii2243Ls3RSS 	a_4>3J__Y]__```t$$$$$r   c                     | j         S N)name)r   s    r   __str__zReference.__str__I   s
    yr   objectr   logmsgc                     d}|*| j         j        }|j        s|j        | k    r| j        j        }t                                          ||           | | j         j                            ||           | S )zqSpecial version which checks if the head-log needs an update as well.

        :return:
            self
        N)	r$   headis_detachedrefcommitbinshar,   
set_object
log_append)r   r2   r3   	oldbinshar5   r+   s        r   r:   zReference.set_objectO   s     	9>D# /D(8(8 K.	 	66***  IN%%i888 r   c                     | j                             d          }t          |          dk     r| j         S d                    |dd                   S )zi
        :return:
            (shortest) Name of this reference - it may contain path components
        r'         N)r   splitlenjoinr   tokenss     r   r0   zReference.namex   sH     %%v;;??9xxqrr
###r   clscommon_pathr   kwargsc                 .    |                      ||          S )zEquivalent to
        :meth:`SymbolicReference.iter_items <git.refs.symbolic.SymbolicReference.iter_items>`,
        but will return non-detached references as well.)_iter_items)rE   r$   rF   r   rG   s        r   
iter_itemszReference.iter_items   s     t[111r   c                 F    | j                             d          }|d         S )z
        :return:
            Name of the remote we are a reference of, such as ``origin`` for a reference
            named ``origin/master``.
        r'   r?   )r   r@   rC   s     r   remote_namezReference.remote_name   s!     %%ayr   c                 p    | j                             d          }d                    |dd                   S )z
        :return:
            Name of the remote head itself, e.g. ``master``.

        :note:
            The returned name is usually not qualified enough to uniquely identify a
            branch.
        r'   r>   N)r   r@   rB   rC   s     r   remote_headzReference.remote_head   s1     %%xxqrr
###r   )Tr/   )r   
__module____qualname____doc__	__slots___points_to_commits_only_resolve_ref_on_creater*   r   boolr-   r(   r1   r   r   r:   propertyr0   classmethodr   r   r	   r   rJ   r    rL   rN   __classcell__)r+   s   @r   r   r   )   s         I#!!% %V %8 % %QU % % % % % %&     $(% %l$7<=% c4i % 
	% % % % % %R 
$c 
$ 
$ 
$ X
$  .2
2 
2,
2
2 8T>*
2 	
2
 
2 
,	
2 
2 
2 [
2  S     X 
$S 
$ 
$ 
$  X
$ 
$ 
$ 
$ 
$r   N)__all__git.utilr   r   symbolicr   r   typingr	   r
   r   r   r   r   	git.typesr   r   r   git.repor   r    r   r"   r   r   <module>r_      s    - + + + + + + + + 5 5 5 5 5 5 5 5 G F F F F F F F F F F F F F F F 0 0 0 0 0 0 0 0 0 0 (37"3 b8I    "E$ E$ E$ E$ E$!9k E$ E$ E$ E$ E$r   