403Webshell
Server IP : 198.38.94.13  /  Your IP : 216.73.217.33
Web Server : Apache
System : Linux d4744.dxb1.stableserver.net 5.14.0-611.49.1.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Tue Apr 21 16:39:08 EDT 2026 x86_64
User : revivere ( 1140)
PHP Version : 8.2.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /opt/saltstack/salt/lib/python3.10/site-packages/git/objects/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /opt/saltstack/salt/lib/python3.10/site-packages/git/objects/__pycache__/base.cpython-310.pyc
o

;j-(�@s�ddgZddlmZddlmZddlmZddl	m
Z
mZmZm
Z
ddlmZddlmZmZmZdd	lmZmZmZerbdd
lmZddlmZddlmZdd
lmZddl m!Z!ddl"m#Z#edZ$Gdd�de
�Z%Gdd�de%�Z&dS)�Object�IndexObject�N)�WorkTreeRepositoryUnsupported)�	LazyMixin�
bin_to_hex�join_path_native�stream_copy�)�get_object_type_by_name)�Any�
TYPE_CHECKING�Union)�AnyGitObject�GitObjectTypeString�PathLike)�OStream)�	Reference)�Repo)�Blob)�	Submodule)�Tree)rrrcs0eZdZUdZdZdZejejej	ej
fZdZdZ
eedfed<	ddd	ed
df�fdd�Zeddd
eedfd
efdd��Zeddded
efdd��Zded
df�fdd�Zded
efdd�Zded
efdd�Zd
efdd�Zd
efdd�Zd
efd d!�Z e!d
efd"d#��Z"e!d*d%d&��Z#d+d(d)�Z$�Z%S),rarBase class for classes representing git object types.

    The following four leaf classes represent specific kinds of git objects:

    * :class:`Blob <git.objects.blob.Blob>`
    * :class:`Tree <git.objects.tree.Tree>`
    * :class:`Commit <git.objects.commit.Commit>`
    * :class:`TagObject <git.objects.tag.TagObject>`

    See :manpage:`gitglossary(7)` on:

    * "object": https://git-scm.com/docs/gitglossary#def_object
    * "object type": https://git-scm.com/docs/gitglossary#def_object_type
    * "blob": https://git-scm.com/docs/gitglossary#def_blob_object
    * "tree object": https://git-scm.com/docs/gitglossary#def_tree_object
    * "commit object": https://git-scm.com/docs/gitglossary#def_commit_object
    * "tag object": https://git-scm.com/docs/gitglossary#def_tag_object

    :note:
        See the :class:`~git.types.AnyGitObject` union type of the four leaf subclasses
        that represent actual git object types.

    :note:
        :class:`~git.objects.submodule.base.Submodule` is defined under the hierarchy
        rooted at this :class:`Object` class, even though submodules are not really a
        type of git object. (This also applies to its
        :class:`~git.objects.submodule.root.RootModule` subclass.)

    :note:
        This :class:`Object` class should not be confused with :class:`object` (the root
        of the class hierarchy in Python).
    Z(0000000000000000000000000000000000000000s)�repo�binsha�sizeN�typerrr�returncs:t���||_||_t|�dksJd|t|�f��dS)z�Initialize an object by identifying it by its binary sha.

        All keyword arguments will be set on demand if ``None``.

        :param repo:
            Repository this object is located in.

        :param binsha:
            20 byte SHA1
        �z,Require 20 byte binary sha, got %r, len = %iN)�super�__init__rr�len)�selfrr��	__class__��D/opt/saltstack/salt/lib/python3.10/site-packages/git/objects/base.pyrds
�zObject.__init__�idrcCs|�t|��S)a)
        :return:
            New :class:`Object` instance of a type appropriate to the object type behind
            `id`. The id of the newly created object will be a binsha even though the
            input id may have been a :class:`~git.refs.reference.Reference` or rev-spec.

        :param id:
            :class:`~git.refs.reference.Reference`, rev-spec, or hexsha.

        :note:
            This cannot be a ``__new__`` method as it would always call :meth:`__init__`
            with the input id which is not necessarily a binsha.
        )Z	rev_parse�str)�clsrr%r#r#r$�newwsz
Object.new�sha1cCsB||jkrtd�||�S|j�|�}t|j�||j�}|j|_|S)z�
        :return:
            New object instance of a type appropriate to represent the given binary sha1

        :param sha1:
            20 byte binary sha1.
        scommit)�NULL_BIN_SHAr
�odb�inforrr)r'rr)�oinfo�instr#r#r$�new_from_sha�s
	zObject.new_from_sha�attrcs4|dkr|jj�|j�}|j|_dSt��|�dS)zRetrieve object information.rN)rr+r,rrr�_set_cache_)r r0r-r!r#r$r1�szObject._set_cache_�othercCst|d�sdS|j|jkS)z3:return: ``True`` if the objects have the same SHA1rF��hasattrr�r r2r#r#r$�__eq__��
z
Object.__eq__cCst|d�sdS|j|jkS)z::return: ``True`` if the objects do not have the same SHA1rTr3r5r#r#r$�__ne__�r7z
Object.__ne__cC�
t|j�S)zE:return: Hash of our id allowing objects to be used in dicts and sets)�hashr�r r#r#r$�__hash__�s
zObject.__hash__cCs|jS)z=:return: String of our SHA1 as understood by all git commands)�hexshar;r#r#r$�__str__�szObject.__str__cCsd|jj|jfS)z::return: String with pythonic representation of our objectz
<git.%s "%s">)r"�__name__r=r;r#r#r$�__repr__�szObject.__repr__cCst|j��d�S)z6:return: 40 byte hex version of our 20 byte binary sha�ascii)rr�decoder;r#r#r$r=�sz
Object.hexsharcCs|jj�|j�S)z�
        :return:
            File-object compatible stream to the uncompressed raw data of the object

        :note:
            Returned streams must be read in order.
        )rr+�streamrr;r#r#r$�data_stream�s	zObject.data_stream�ostreamcCs|jj�|j�}t||�|S)z�Write our data directly to the given output stream.

        :param ostream:
            File-object compatible stream object.

        :return:
            self
        )rr+rCrr)r rEZistreamr#r#r$�stream_data�s	
zObject.stream_data)rr)rErrr)&r?�
__module__�__qualname__�__doc__ZNULL_HEX_SHAr*�dbtypZ
str_blob_typeZ
str_tree_typeZstr_commit_typeZstr_tag_typeZTYPES�	__slots__rr
r�__annotations__�bytesr�classmethodr&rr(r/r1r�boolr6r8�intr<r>r@�propertyr=rDrF�
__classcell__r#r#r!r$r&s8
!� 
cs�eZdZdZdZdZ		ddddededefdede	fd	df
�fd
d�
Z
d	efdd
�Zded	df�fdd�Z
ed	efdd��Zed	e	fdd��Z�ZS)ra}Base for all objects that can be part of the index file.

    The classes representing git object types that can be part of the index file are
    :class:`~git.objects.tree.Tree` and :class:`~git.objects.blob.Blob`. In addition,
    :class:`~git.objects.submodule.base.Submodule`, which is not really a git object
    type but can be part of an index file, is also a subclass.
    )�path�moderSNrrrrTrcs2t��||�|dur||_|dur||_dSdS)a�Initialize a newly instanced :class:`IndexObject`.

        :param repo:
            The :class:`~git.repo.base.Repo` we are located in.

        :param binsha:
            20 byte sha1.

        :param mode:
            The stat-compatible file mode as :class:`int`.
            Use the :mod:`stat` module to evaluate the information.

        :param path:
            The path to the file in the file system, relative to the git repository
            root, like ``file.ext`` or ``folder/other.ext``.

        :note:
            Path may not be set if the index object has been created directly, as it
            cannot be retrieved without knowing the parent tree.
        N)rrrTrS)r rrrTrSr!r#r$r�s
�zIndexObject.__init__cCr9)z�
        :return:
            Hash of our path as index items are uniquely identifiable by path, not by
            their data!
        )r:rSr;r#r#r$r<s
zIndexObject.__hash__r0cs0|tjvrtd|t|�jf��t��|�dS)Nz[Attribute '%s' unset: path and mode attributes must have been set during %s object creation)rrK�AttributeErrorrr?rr1)r r0r!r#r$r1s
��zIndexObject._set_cache_cCst�|j�S)zA:return: Name portion of the path, effectively being the basename)�osp�basenamerSr;r#r#r$�nameszIndexObject.namecCs$|jjdurt|jj|j�Std��)a&
        :return:
            Absolute path to this index object in the file system (as opposed to the
            :attr:`path` field which is a path relative to the git repository).

            The returned path will be native to the system and contains ``\`` on
            Windows.
        Nz"working_tree_dir was None or empty)rZworking_tree_dirrrSrr;r#r#r$�abspath s
zIndexObject.abspath)NN)r?rGrHrIrKZ_id_attribute_rMr
rPrrr<r&r1rQrXrYrRr#r#r!r$r�s.���
�
��!)'�__all__Zos.pathrSrVZ	gitdb.typ�typrJZgit.excrZgit.utilrrrr�utilr
�typingrrr
Z	git.typesrrrZ
gitdb.baserZgit.refs.referencerZgit.reporZblobrZsubmodule.baserZtreerZ
IndexObjUnionrrr#r#r#r$�<module>s&4

Youez - 2016 - github.com/yon3zu
LinuXploit