yL idgZddlmZmZddlmZmZddlmZm Z m Z m Z m Z m Z ddlmZmZmZe rddlmZde d efd e d effd ZGd deeeZy ) Reference) IterableObj LazyMixin)SymbolicReference T_References)AnyCallableIterator TYPE_CHECKINGTypeUnion) AnyGitObjectPathLike_T)Repofunc.returncZdtdtdtffd }j|_|S)zZA decorator raising :exc:`ValueError` if we are not a valid remote, based on the path.selfargsrcf|jstd|jz|g|S)Nz1ref path does not point to a remote reference: %s) is_remote ValueErrorpath)rrrs X/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/git/refs/reference.pywrapperz(require_remote_ref_path..wrappers5~~PSWS\S\\] ]D 4  )rr r__name__)rrs` rrequire_remote_ref_pathr s0!l!3!2! }}G NrceZdZdZdZdZdZdZdddded e d d ffd Z d e fd Z dde ede fde e d fd dffd Zed e fdZe ddeeddde ed fdeded eef dZeed e fdZeed e fdZxZS)rzA named reference to any object. Subclasses may apply restrictions though, e.g., a :class:`~git.refs.head.Head` can only point to commits. FTrefsreporr check_pathrNc|rLt|j|jdzs%td|jj d||t |||y)aInitialize 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. /zCannot instantiate z from path N)str startswith_common_path_defaultr __class__rsuper__init__)rr$rr%r+s rr-zReference.__init__6s\ c$i2243L3Ls3RS24>>3J3J2M[Y]X^_` `  t$rc|jSN)name)rs r__str__zReference.__str__Is yyrobjectrlogmsgcd}|G|jj}|js%|j|k(r|jj }t ||||&|jjj|||S)zqSpecial version which checks if the head-log needs an update as well. :return: self N) r$head is_detachedrefcommitbinshar, set_object log_append)rr2r3 oldbinshar5r+s rr:zReference.set_objectOsx  99>>D##D(8 KK..  66*   IINN % %i 8 rc|jjd}t|dkr |jSdj|ddS)zi :return: (shortest) Name of this reference - it may contain path components r'N)rsplitlenjoinrtokenss rr0zReference.namexs@% v;?99 xxqr ##rcls common_pathrkwargsc&|j||S)zEquivalent to :meth:`SymbolicReference.iter_items `, but will return non-detached references as well.) _iter_items)rEr$rFrrGs r iter_itemszReference.iter_itemsst[11rcB|jjd}|dS)z :return: Name of the remote we are a reference of, such as ``origin`` for a reference named ``origin/master``. r'r?)rr@rCs r remote_namezReference.remote_names %ayrc`|jjd}dj|ddS)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)rr@rBrCs r remote_headzReference.remote_heads+%xxqr ##r)Tr/)r __module__ __qualname____doc__ __slots___points_to_commits_only_resolve_ref_on_creater*rboolr-r(r1rrr:propertyr0 classmethodr rr r rJr rLrN __classcell__)r+s@rrr)sQ I#!!%V%8%%QU%&$(%l$7<=%c4i %  %R $c $ $.2 2 ,  2 28T>* 2 2  2 ,  2 2 S $S $ $rN)__all__git.utilrrsymbolicrrtypingr r r r r r git.typesrrrgit.reporr rr"rrr_sa -+5GF00 (37"3 b8I "E$!9kE$r