
    _Og-                        S r SSKrSSKJr  SSKJr  SSKJr   " S S\R                  5      r	 " S	 S
\R                  5      r
 " S S\
5      r " S S\
5      r " S S\R                  5      r " S S\R                  5      r " S S\R                  5      r " S S\R                  5      r " S S\R                  5      r " S S\R                  5      rg)zk
This module contains all the classes relating to Git Data.

See also: http://developer.github.com/v3/git/
    N)dumps   )models)requires_authc                   *    \ rS rSrSrS rS rS rSrg)Blob   as  This object provides an interface to the API representation of a blob.

See also: http://developer.github.com/v3/git/blobs/

.. versionchanged:: 1.0.0

   - The :attr:`content` is no longer forcibly coerced to bytes.

This object has the following atributes

.. attribute:: content

    The raw content of the blob. This may be base64 encoded text. Use
    :meth:`decode_content` to receive the non-encoded text.

.. attribute:: encoding

    The encoding that GitHub reports for this blob's content.

.. attribute:: size

    The size of this blob's content in bytes.

.. attribute:: sha

    The SHA1 of this blob's content.
c                 h    US   U l         US   U l        US   U l        US   U l        US   U l        g )Nurlcontentencodingsizesha)_apir   r   r   r   )selfblobs     P/Users/admin/workspace/ai/Jarvis/env/lib/python3.13/site-packages/github3/git.py_update_attributesBlob._update_attributes*   s:    K	IZ(L	;    c                 $    SU R                   S S3$ )Nz<Blob [z.10]>r   r   s    r   _repr
Blob._repr1   s    #b))r   c                     U R                   S:X  aO  U R                  (       a>  [        R                  " U R                  R	                  S5      5      R                  S5      $ U R                  $ )zReturn the unencoded content of this blob.

If the content is base64 encoded, this will properly decode it.
Otherwise, it will return the content as returned by the API.

:returns:
    Decoded content as text
:rtype:
    unicode
base64zutf-8)r   r   r   	b64decodeencodedecoder   s    r   decode_contentBlob.decode_content4   sR     ==H$##DLL$7$7$@AHH  ||r   )r   r   r   r   r   N)	__name__
__module____qualname____firstlineno____doc__r   r   r"   __static_attributes__ r   r   r   r      s    8*r   r   c                   $    \ rS rSrS rS rS rSrg)_CommitF   c                 F   US   U l         US   U l        U R                  R                  S5      (       a  U R                  S   U l        US   U l        U R                  (       a   U R                  R                  S5      U l        US   U l        [        US   U 5      U l        g )Nr   authorname	committermessagetree)	r   r/   get_author_namer1   _commit_namer2   
CommitTreer3   )r   commits     r   r   _Commit._update_attributesI   s    5M	X&;;??6"" $F 3D,>> $ 2 26 :Di(vf~t4	r   c                 <    SU R                    SU R                   S3$ )N<z [r   )
class_namer   r   s    r   r   _Commit._reprT   s     4??#2dhhZr22r   )r   r5   r6   r/   r1   r2   r3   N)r$   r%   r&   r'   r<   r   r   r)   r*   r   r   r,   r,   F   s    J	53r   r,   c                   0   ^  \ rS rSrSrS rU 4S jrSrU =r$ )CommitX   a  This represents a commit as returned by the git API.

This is distinct from :class:`~github3.repos.commit.RepoCommit`.
Primarily this object represents the commit data stored by git and
it has no relationship to the repository on GitHub.

See also: http://developer.github.com/v3/git/commits/

This object has all of the attributes of a
:class:`~github3.git.ShortCommit` as well as the following attributes:

.. attribute:: parents

    The list of commits that are the parents of this commit. This may be
    empty if this is the initial commit, or it may have several if it is
    the result of an octopus merge. Each parent is represented as a
    dictionary with the API URL and SHA1.

.. attribute:: sha

    The unique SHA1 which identifies this commit.

.. attribute:: verification

    The GPG verification data about this commit. See
    https://developer.github.com/v3/git/commits/#commit-signature-verification
    for more information.
c                   > [         TU ]  U5        US   U l        US   U l        U R                  (       d2  U R                  R                  S5      nU R                  US-   S  U l        U R                  U l        US   U l        g )Nparentsr   /r   verification)superr   rB   r   r   rfind_uniqrD   )r   r8   i	__class__s      r   r   Commit._update_attributesx   sn    "6*i(%=xx		$AyyQ)DHXX
">2r   )rG   rB   r   rD   )	r$   r%   r&   r'   r(   r<   r   r)   __classcell__)rI   s   @r   r?   r?   X   s    : J3 3r   r?   c                        \ rS rSrSrS r\rSrg)ShortCommit   a  This represents a commit as returned by the git API.

This is distinct from :class:`~github3.repos.commit.RepoCommit`.
Primarily this object represents the commit data stored by git. This
shorter representation of a Commit is most often found on a
:class:`~github3.repos.commit.RepoCommit` to represent the git data
associated with it.

See also: http://developer.github.com/v3/git/commits/

This object has the following attributes:

.. attribute:: author

    This is a dictionary with at least the name and email of the author
    of this commit as well as the date it was authored.

.. attribute:: committer

    This is a dictionary with at least the name and email of the committer
    of this commit as well as the date it was committed.

.. attribute:: message

    The commit message that describes the changes as written by the author
    and committer.

.. attribute:: tree

    The git tree object this commit points to.
r*   N)	r$   r%   r&   r'   r(   r<   r?   _refresh_tor)   r*   r   r   rM   rM      s    @ JKr   rM   c                   H    \ rS rSrSrS rS r\S 5       r\S	S j5       r	Sr
g)
	Reference   a  Object representing a git reference associated with a repository.

This represents a reference (or ref) created on a repository via git.

See also: http://developer.github.com/v3/git/refs/

This object has the following attributes:

.. attribute:: object

    A :class:`~github3.git.GitObject` that this reference points to.

.. attribute:: ref

    The string path to the reference, e.g., ``'refs/heads/sc/feature-a'``.
c                 T    US   U l         [        US   U 5      U l        US   U l        g )Nr   objectref)r   	GitObjectrT   rU   )r   rU   s     r   r   Reference._update_attributes   s*    J	Ht4u:r   c                 "    SU R                    S3$ )Nz<Reference [r   )rU   r   s    r   r   Reference._repr   s    dhhZr**r   c                 Z    U R                  U R                  U R                  5      SS5      $ )z[Delete this reference.

:returns:
    True if successful, False otherwise
:rtype:
    bool
   i  )_boolean_deleter   r   s    r   deleteReference.delete   s$     }}T\\$))4c3??r   c                     XS.nU R                  U R                  U R                  [        U5      S9S5      nU(       a  U R	                  U5        gg)zUpdate this reference.

:param str sha:
    (required), sha of the reference
:param bool force:
    (optional), force the update or not
:returns:
    True if successful, False otherwise
:rtype:
    bool
)r   force)data   TF)_json_patchr   r   r   )r   r   ra   rb   jsons        r   updateReference.update   sH     +zz$++diieDk+BCH##D)r   )r   rT   rU   N)F)r$   r%   r&   r'   r(   r   r   r   r^   rg   r)   r*   r   r   rQ   rQ      s;    "
+ @ @  r   rQ   c                   $    \ rS rSrSrS rS rSrg)rV      a  This object represents an arbitrary 'object' in git.

This object is intended to be versatile and is usually found on one of the
following:

- :class:`~github3.git.Reference`
- :class:`~github3.git.Tag`

This object has the following attributes:

.. attribute:: sha

    The SHA1 of the object this is representing.

.. attribute:: type

    The name of the type of object this is representing.
c                 @    US   U l         US   U l        US   U l        g )Nr   r   typer   r   rl   )r   objs     r   r   GitObject._update_attributes   s#    J	u:K	r   c                 "    SU R                    S3$ )Nz<Git Object [r   r   r   s    r   r   GitObject._repr       txxj++r   rm   Nr$   r%   r&   r'   r(   r   r   r)   r*   r   r   rV   rV      s    & 
,r   rV   c                   $    \ rS rSrSrS rS rSrg)Tag   a  This represents an annotated tag.

Tags are a special kind of git reference and annotated tags have more
information than lightweight tags.

See also: http://developer.github.com/v3/git/tags/

This object has the following attributes:

.. attribute:: message

    This is the message that was written to accompany the creation of the
    annotated tag.

.. attribute:: object

    A :class:`~github3.git.GitObject` that represents the underlying git
    object.

.. attribute:: sha

    The SHA1 of this tag in the git repository.

.. attribute:: tag

    The "lightweight" tag (or reference) that backs this annotated tag.

.. attribute:: tagger

    The person who created this tag.
c                     US   U l         US   U l        [        US   U 5      U l        US   U l        US   U l        US   U l        g )Nr   r2   rT   r   tagtagger)r   r2   rV   rT   r   rx   ry   )r   rx   s     r   r   Tag._update_attributes   sK    J	9~Ht4u:u:(mr   c                 "    SU R                    S3$ )Nz<Tag [r   )rx   r   s    r   r   	Tag._repr(  s    z$$r   )r   r2   rT   r   rx   ry   Nrs   r*   r   r   ru   ru      s    @$%r   ru   c                   .    \ rS rSrSrS rS rS r\rSr	g)r7   i,  a  This object represents the abbreviated tree data in a commit.

The API returns different representations of different objects. When
representing a :class:`~github3.git.ShortCommit` or
:class:`~github3.git.Commit`, the API returns an abbreviated
representation of a git tree.

This object has the following attributes:

.. attribute:: sha

    The SHA1 of this tree in the git repository.
c                 ,    US   U l         US   U l        g )Nr   r   r   r   )r   r3   s     r   r   CommitTree._update_attributes;  s    K	;r   c                 "    SU R                    S3$ )Nz<CommitTree [r   r   r   s    r   r   CommitTree._repr?  rr   r   c                     U R                  U R                  U R                  5      S5      nU R                  [        U5      $ )zRetrieve a full Tree object for this CommitTree.

:returns:
    The full git data about this tree
:rtype:
    :class:`~github3.git.Tree`
rc   rd   _getr   _instance_or_nullTreer   rf   s     r   to_treeCommitTree.to_treeB  s4     zz$))DII.4%%dD11r   r   N)
r$   r%   r&   r'   r(   r   r   r   refreshr)   r*   r   r   r7   r7   ,  s    ,	2 Gr   r7   c                   6    \ rS rSrSrS rS rS rS rS r	Sr
g	)
r   iP  a  This represents a tree object from a git repository.

Trees tend to represent directories and subdirectories.

See also: http://developer.github.com/v3/git/trees/

This object has the following attributes:

.. attribute:: sha

    The SHA1 of this tree in the git repository.

.. attribute:: tree

    A list that represents the nodes in the tree. If this list has members
    it will have instances of :class:`~github3.git.Hash`.
c                     US   U l         US   U l        US   U l        U R                  (       a,  U R                   Vs/ s H  n[        X 5      PM     snU l        g g s  snf )Nr   r   r3   )r   r   r3   Hash)r   r3   ts      r   r   Tree._update_attributesc  sP    K	;L	9904		:	1a	:DI :s   Ac                 "    SU R                    S3$ )Nz<Tree [r   r   r   s    r   r   
Tree._reprj      
"%%r   c                 D    U R                  5       UR                  5       :H  $ Nas_dictr   others     r   __eq__Tree.__eq__m      ||~00r   c                 D    U R                  5       UR                  5       :g  $ r   r   r   s     r   __ne__Tree.__ne__p  r   r   c                     U R                  U R                  U R                  SS0S9S5      nU R                  [        U5      $ )zYRecurse into this tree.

:returns:
    A new tree
:rtype:
    :class:`~github3.git.Tree`
	recursive1)paramsrc   r   r   s     r   recurseTree.recurses  sB     zzIIdiic(:I;S
 %%dD11r   )r   r   r3   N)r$   r%   r&   r'   r(   r   r   r   r   r   r)   r*   r   r   r   r   P  s     $;&112r   r   c                   $    \ rS rSrSrS rS rSrg)r   i  a  This is used to represent the elements of a tree.

This provides the path to the object and the type of object it is. For
a brief explanation of what these types are and represent, this
StackOverflow question answers some of that:
https://stackoverflow.com/a/18605496/1953283

See also: http://developer.github.com/v3/git/trees/#create-a-tree

This object has the following attributes:

.. attribute:: mode

    The mode of the file, directory, or link.

.. attribute:: path

    The path to the file, directory, or link.

.. attribute:: sha

    The SHA1 for this hash.

.. attribute:: size

    This attribute is only not ``None`` if the :attr:`type` is not a tree.

.. attribute:: type

    The type of git object this is representing, e.g., tree, blob, etc.
c                     UR                  S5      U l        US   U l        US   U l        US   U l        S U l        US   U l        U R                  S:w  a  UR                  S5      U l        g g )Nr   modepathr   rl   r3   r   )r4   r   r   r   r   r   rl   )r   infos     r   r   Hash._update_attributes  se    HHUO	L	L	;	L	99(DI r   c                 "    SU R                    S3$ )Nz<Hash [r   r   r   s    r   r   
Hash._repr  r   r   )r   r   r   r   r   rl   Nrs   r*   r   r   r   r     s    @	)&r   r   )r(   r   rf   r    r   
decoratorsr   
GitHubCorer   r,   r?   rM   rQ   rV   ru   r7   r   r   r*   r   r   <module>r      s   
    %66 6r3f 3$(3W (3V"' "J7!! 7t,!! ,:*%&

 *%Z!"" !H.26 .2b-&6 -&r   