403Webshell
Server IP : 217.160.0.244  /  Your IP : 216.73.217.138
Web Server : Apache
System : Linux infong-eu155 4.4.400-icpu-108 #2 SMP Wed Feb 11 11:51:01 UTC 2026 x86_64
User : u100174116 ( 6746176)
PHP Version : 8.5.10
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /lib/python3/dist-packages/dulwich/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /lib/python3/dist-packages/dulwich/__pycache__/refs.cpython-313.pyc
�

mEdgܟ���SrSSKrSSKrSSKJr SSKJr SSKJrJ	r	 SSK
JrJr SSK
JrJr SS	KJrJrJrJrJr SS
KJr \rSrSrS
rSrSr\"S5r Sr!\!r""SS\#5r$S\S\4Sjr%S\S\&4Sjr'"SS5r("SS\(5r)"SS\(5r*"SS \(5r+S!r,S"r-S#r.S:S;S$jjr/S%r0S&\4S'jr1S(r2S)r3S*r4S;S+jr5S,\(S-\S.\	\S/\S0\	\S\4S1jr6S2r7S<S3\(S4\8S,\9\8\84S5\	\S6\&S7\&SS4S8jjr:S9r;g)=z
Ref handling.�N)�Iterator)�suppress)�Any�Optional�)�PackedRefsException�RefFormatError)�GitFile�ensure_dir_exists)�ZERO_SHA�ObjectID�Tag�git_line�valid_hexsha)�ObjectContainersHEADsref: srefs/heads/s
refs/tags/�
refs/remotes/s ~^:?*[s^{}c�"�\rSrSrSrSSjrSrg)�
SymrefLoop�2z,There is a loop between one or more symrefs.Nc��XlX lg�N)�ref�depth)�selfrrs   �./usr/lib/python3/dist-packages/dulwich/refs.py�__init__�SymrefLoop.__init__5s�����
�)rr��returnN)�__name__�
__module__�__qualname__�__firstlineno__�__doc__r�__static_attributes__�rrrr2s
��6�rr�contentsr c��UR[5(a!U[[5SRS5$[	U5e)zPParse a symref value.

Args:
  contents: Contents to parse
Returns: Destination
N�
)�
startswith�SYMREF�len�rstrip�
ValueError)r(s r�parse_symref_valuer0:s<�����6�"�"���F��
�&�-�-�g�6�6�
�X�
�r�refnamec� �SU;dURS5(agSU;agSU;ag[U5H%up[XUS-5S:dU[;dM% g USS;agUR	S	5(agS
U;agSU;agg)
aCheck if a refname is correctly formatted.

Implements all the same rules as git-check-ref-format[1].

[1]
http://www.kernel.org/pub/software/scm/git/docs/git-check-ref-format.html

Args:
  refname: The refname to check
Returns: True if refname is valid, False otherwise
s/.�.F�/s..r� ���s.locks@{�\T)r+�	enumerate�ord�
BAD_REF_CHARS�endswith)r1�i�cs   r�check_ref_formatr>Fs���
���7�-�-�d�3�3���7��������'�"����w�1�q�5�!�"�T�)�Q�-�-?��#��r�{�e�������!�!����������rc��\rSrSrSrS&S'SjjrS(S'SjjrS(S'SjjrS\\	\
44SjrS	\\	\\
4SS4S
jr
S\\
4SjrS)S\	S
\\	\
4S\\S\\S\\S\\S\SS4SjjrS\\	4SjrSrS&SjrSrS&S\\	\
44SjjrS'SjrSrS\4SjrS\\\\44SjrS\4SjrS\
4SjrS(S\4Sjjr S(S\4S jjr!S'S!jr"S(S\4S"jjr#S'S#jr$S$r%S%r&g)*�
RefsContainer�hzA container for refs.Nr c��Xlgr��_logger)r�loggers  rr�RefsContainer.__init__ks���rc	�P�URcgUcgURXX4XVU5 grrC)rr�old_sha�new_sha�	committer�	timestamp�timezone�messages        r�_log�RefsContainer._logns+���<�<����?�����S�7�y�G�Trc�,�[UR5e)z�Make a ref point at another ref.

Args:
  name: Name of the ref to set
  other: Name of the ref to point at
  message: Optional message
)�NotImplementedError�set_symbolic_ref)r�name�otherrJrKrLrMs       rrR�RefsContainer.set_symbolic_ref~s�� "�$�"7�"7�8�8rc�,�[UR5e)��Get contents of the packed-refs file.

Returns: Dictionary mapping ref names to SHA1s

Note: Will return an empty dictionary when no packed-refs file is
    present.
)rQ�get_packed_refs�rs rrX�RefsContainer.get_packed_refs�s��"�$�"6�"6�7�7r�new_refsc�,�[UR5e)��Add the given refs as packed refs.

Args:
  new_refs: A mapping of ref names to targets; if a target is None that
    means remove the ref
)rQ�add_packed_refs)rr[s  rr^�RefsContainer.add_packed_refs�s��"�$�"6�"6�7�7rc��g�a5Return the cached peeled value of a ref, if available.

Args:
  name: Name of the ref to peel
Returns: The peeled value of the ref. If the ref is known not point to
    a tag, this will be the SHA the ref refers to. If the ref may point
    to a tag, but no cached information is available, None is returned.
Nr'�rrSs  r�
get_peeled�RefsContainer.get_peeled�s��r�baserTrJrKrLrM�prunec��U(a[URU55nO
[5nUR5HVup�U
cURU	5 O!UR	SRX45SX�S9 U(dMDUR
U	5 MX UH$nURSRX45SUS9 M& g![a M�f=f)Nr4�rM)	�set�subkeys�items�add�
set_if_equals�join�remove�KeyError�remove_if_equals)rrerTrJrKrLrMrf�	to_deleterS�valuers            r�import_refs�RefsContainer.import_refs�s�����D�L�L��.�/�I���I� �;�;�=�K�D��}��
�
�d�#��"�"��I�I�t�l�+�T�5�#���y���$�$�T�*�)��C��!�!�$�)�)�T�K�"8�$��!�P��� ����s�C�
C�Cc�,�[UR5e)z#All refs present in this container.)rQ�allkeysrYs rrw�RefsContainer.allkeys�s��!�$�,�,�/�/rc�4�[UR55$r)�iterrwrYs r�__iter__�RefsContainer.__iter__�s���D�L�L�N�#�#rc�J�UbURU5$UR5$)z�Refs present in this container.

Args:
  base: An optional base to return refs under.
Returns: An unsorted set of valid refs in this container, including
    packed refs.
)rjrw)rres  r�keys�RefsContainer.keys�s%�����<�<��%�%��<�<�>�!rc��[5n[U5S-nUR5H.nURU5(dMUR	XCS5 M0 U$)z�Refs present in this container under a base.

Args:
  base: The base to return refs under.
Returns: A set of valid refs in this container under the base; the base
    prefix is stripped from the ref names returned.
rN)rir-rwr+rl)rrer~�base_lenr1s     rrj�RefsContainer.subkeys�sQ���u���t�9�q�=���|�|�~�G��!�!�$�'�'������+�,�&��rc���0nURU5nUcSnOURS5nUHnXS-U-RS5X$'M! U$![[4a M8f=f)z6Return the contents of this container as a dictionary.rr4)r~r.�striprrp)rre�retr~�keys     r�as_dict�RefsContainer.as_dict�sy�����y�y�����<��D��;�;�t�$�D��C�
����s�!2� 9� 9�$� ?�@�����
����)�
��
�s�A�A&�%A&c��U[S4;agURS5(a[USS5(d[U5eg)a�Ensure a refname is valid and lives in refs or is HEAD.

HEAD is not a valid refname according to git-check-ref-format, but this
class needs to be able to touch HEAD. Also, check_ref_format expects
refnames without the leading 'refs/', but this class requires that
so it cannot touch anything outside the refs dir (or HEAD).

Args:
  name: The name of the reference.

Raises:
  KeyError: if a refname is not HEAD or is otherwise not valid.
s
refs/stashNsrefs/�)�HEADREFr+r>r	rbs  r�_check_refname�RefsContainer._check_refname�sE���G�]�+�+�����x�(�(�0@��a�b��0J�0J� ��&�&�1Krc�v�URU5nU(d UR5RUS5nU$)z�Read a reference without following any references.

Args:
  refname: The name of the reference
Returns: The contents of the ref file, or None if it does
    not exist.
N)�read_loose_refrX�get)rr1r(s   r�read_ref�RefsContainer.read_refs7���&�&�w�/����+�+�-�1�1�'�4�@�H��rc�,�[UR5e)z�Read a loose reference and return its contents.

Args:
  name: the refname to read
Returns: The contents of the ref file, or None if it does
    not exist.
)rQr�rbs  rr��RefsContainer.read_loose_refs��"�$�"5�"5�6�6rc�8�[U-nSn/nUR[5(aqU[[5SnURU5 UR	U5nU(dXB4$US-
nUS:�a[X5eUR[5(aMqXB4$)z|Follow a reference name.

Returns: a tuple of (refnames, sha), wheres refnames are the names of
    references in the chain
rNrr�)r,r+r-�appendr�r)rrSr(r�refnamesr1s      r�follow�RefsContainer.follow(s����D�=�������!�!�&�)�)��s�6�{�}�-�G��O�O�G�$��}�}�W�-�H����!�!�
�Q�J�E��q�y� ��-�-��!�!�&�)�)��!�!rc�2�URU5(agg)NTF)r�)rr1s  r�__contains__�RefsContainer.__contains__<s���=�=��!�!��rc�H�URU5up#Uc[U5eU$)zQGet the SHA1 for a reference name.

This method follows all symbolic references.
)r�rp)rrS�_�shas    r�__getitem__�RefsContainer.__getitem__As(��
���T�"����;��4�.� ��
rc�,�[UR5e)a�Set a refname to new_ref only if it currently equals old_ref.

This method follows all symbolic references if applicable for the
subclass, and can be used to perform an atomic compare-and-swap
operation.

Args:
  name: The refname to set.
  old_ref: The old sha the refname must refer to, or None to set
    unconditionally.
  new_ref: The new sha the refname will refer to.
  message: Message for reflog
Returns: True if the set was successful, False otherwise.
)rQrm)rrS�old_ref�new_refrJrKrLrMs        rrm�RefsContainer.set_if_equalsKs��0"�$�"4�"4�5�5rc�,�[UR5e)z`Add a new reference only if it does not already exist.

Args:
  name: Ref name
  ref: Ref value
)rQ�
add_if_new�rrSrrJrKrLrMs       rr��RefsContainer.add_if_newes��"�$�/�/�2�2rc��[U5(d)UR[5(d[U<S35eUR	USU5 g)asSet a reference name to point to the given SHA1.

This method follows all symbolic references if applicable for the
subclass.

Note: This method unconditionally overwrites the contents of a
    reference. To update atomically only if the reference has not
    changed, use set_if_equals().

Args:
  name: The refname to set.
  ref: The new sha the refname will refer to.
z+ must be a valid sha (40 chars) or a symrefN)rr+r,r/rm)rrSrs   r�__setitem__�RefsContainer.__setitem__psB���S�!�!�S�^�^�F�%;�%;���w�&Q�R�S�S����4��s�+rc�,�[UR5e)a�Remove a refname only if it currently equals old_ref.

This method does not follow symbolic references, even if applicable for
the subclass. It can be used to perform an atomic compare-and-delete
operation.

Args:
  name: The refname to delete.
  old_ref: The old sha the refname must refer to, or None to
    delete unconditionally.
  message: Message for reflog
Returns: True if the delete was successful, False otherwise.
)rQrq)rrSr�rJrKrLrMs       rrq�RefsContainer.remove_if_equals�s��,"�$�"7�"7�8�8rc�(�URUS5 g)a3Remove a refname.

This method does not follow symbolic references, even if applicable for
the subclass.

Note: This method unconditionally deletes the contents of a reference.
    To delete atomically only if the reference has not changed, use
    remove_if_equals().

Args:
  name: The refname to delete.
N)rqrbs  r�__delitem__�RefsContainer.__delitem__�s��	
���d�D�)rc��0nUR5H"n[URU55nX1U'M$ U$![a M5f=f)zeGet a dict with all symrefs in this container.

Returns: Dictionary mapping source ref to target ref
)rwr0r�r/)rr��src�dsts    r�get_symrefs�RefsContainer.get_symrefs�sU��
���<�<�>�C�
�(����s�);�<���C��
"��
��	�
��
�s�;�
A	�A	rCrr�NNNN)NNNNF)'r!r"r#r$r%rrNrR�dict�Refr
rXrr^rc�bytes�boolrtrrwr{r~rjr�r�r�r��tuple�listr�r�r�rmr�r�rqr�r�r&r'rrr@r@hs���������U�
�U�(����9�
�9�$8��c�8�m�!4�8�8��S�(�8�2D�-D�(E�8�$�8�	�(�8�"4�	�&*�%)�$(�#'��Q��Q��C��M�"�Q��E�?�	Q�
�E�?�Q��5�/�
Q��%��Q��Q�
�Q�:0��#��0�$�"�
��D��h��$7�� '�&�7�e�7�"�e�D��K��$6�7�"�(�t��
�8������6�
�6�6QU�	3�	
�	3�,�,����9�
�9�0
*�
rr@c	��^�\rSrSrSrSSU4SjjjrSrSrSrSS	jr	SS
\
S\
SS4SjjrSS\4S
jjr
SS
\
S\S\\S\4SjjrSS\4SjjrSrSSjrSSjrSrU=r$)�DictRefsContaineri�z}RefsContainer backed by a simple dict.

This container does not support symbolic or packed references and is not
threadsafe.
Nr c�X>�[TU]US9 Xl0Ul[	5Ulg)N�rE)�superr�_refs�_peeledri�	_watchers)r�refsrE�	__class__s   �rr�DictRefsContainer.__init__�s(���
�����'��
�.0���#&�5��rc�6�URR5$r�r�r~rYs rrw�DictRefsContainer.allkeys�����z�z��� � rc�:�URRUS5$r�r�r�rbs  rr�� DictRefsContainer.read_loose_ref�����z�z�~�~�d�D�)�)rc��0$rr'rYs rrX�!DictRefsContainer.get_packed_refs�����	rc�N�URHnURX45 M gr)r��_notify)rr�newsha�watchers    rr��DictRefsContainer._notify�s���~�~�G��O�O�S�M�*�&rrSrTc
��URU5Sn[U-nX�RU'URX5 UR	UUUUUUUS9 g)Nr6�rJrKrLrM)r�r,r�r�rN)	rrSrTrJrKrLrM�old�news	         rrR�"DictRefsContainer.set_symbolic_ref�s^���k�k�$���#���u�n���
�
�4�����T���	�	��������	�	
rc�L�Ub%URRU[5U:wagURU5up�UHcn
UR	U
5 URRU
5nX0RU
'URX�5 UR
U
UUUUUUS9 Me g�NFr�T)r�r�rr�r�r�rN)rrSr�r�rJrKrLrM�	realnamesr��realnamer�s            rrm�DictRefsContainer.set_if_equals�s�����4�:�:�>�>�$��#A�W�#L���{�{�4�(��	�!�H�����)��*�*�.�.��*�C�#*�J�J�x� ��L�L��+��I�I����#�#�!��
�
�"�rrrMc
��XR;agX RU'URX5 URUSUUUUUS9 gr�)r�r�rNr�s       rr��DictRefsContainer.add_if_newsT���:�:����
�
�4�����T���	�	��������	�	
�rc
��Ub%URRU[5U:wagURRU5nUR	US5 URUUSUUUUS9 g![a gf=fr�)r�r�r�popr�rNrp)rrSr�rJrKrLrMr�s        rrq�"DictRefsContainer.remove_if_equalss�����4�:�:�>�>�$��#A�W�#L��	��*�*�.�.��&�C�
�L�L��t�$��I�I����#�#�!��
�
����	���	�s�A-�-
A:�9A:c�8�URRU5$r)r�r�rbs  rrc�DictRefsContainer.get_peeled;s���|�|����%�%rc�\�UR5Hup#URUSU5 M g)z0Update multiple refs; intended only for testing.N)rkrm)rr�rr�s    r�_update�DictRefsContainer._update>s(���
�
��H�C����s�D�#�.�%rc�:�URRU5 g)z5Update cached peeled refs; intended only for testing.N)r��update)r�peeleds  r�_update_peeled� DictRefsContainer._update_peeledEs�������F�#r)r�r�r�rrr�)r!r"r#r$r%rrwr�rXr�r�rRr�rmr
rr�r�rqrcr�r�r&�
__classcell__�r�s@rr�r��s�����)�)�!�*��+�����
��
��
�
�
�8�����
��B���#'�������%���
��8�����
��8&�/�$�$rr�c�:�\rSrSrSrS
SjrSrSrSrSr	S	r
g)�InfoRefsContaineriJz5Refs container that reads refs from a info/refs file.Nc�f�0Ul0Ul[U5n[U5uUlUlgr)r�r��read_info_refs�split_peeled_refs)r�fr�s   rr�InfoRefsContainer.__init__Ms-����
�����a� ��%6�t�%<�"���T�\rc�6�URR5$rr�rYs rrw�InfoRefsContainer.allkeysSr�rc�:�URRUS5$rr�rbs  rr�� InfoRefsContainer.read_loose_refVr�rc��0$rr'rYs rrX�!InfoRefsContainer.get_packed_refsYr�rc�`�URU$![a URUs$f=fr)r�rpr�rbs  rrc�InfoRefsContainer.get_peeled\s4��	$��<�<��%�%���	$��:�:�d�#�#�	$�s��-�-)r�r�r)r!r"r#r$r%rrwr�rXrcr&r'rrr�r�Js��?�=�!�*��$rr�c	�
^�\rSrSrSrSSU4SjjjrS\4SjrSrSr	S	r
S
rS\\
\\4SS4SjrS
rSrSSjrSSSjjrSS\4SjjrSS\S\S\\S\4SjjrSS\4SjjrSrU=r$)�DiskRefsContainericz)Refs container that reads refs from disk.Nr c��>�[TU]US9 [USS5b[R"U5nXlUcUn[USS5b[R"U5nX lSUlSUlg)Nr��encode)	r�r�getattr�os�fsencode�path�
worktree_path�_packed_refs�_peeled_refs)rr
rrEr�s    �rr�DiskRefsContainer.__init__fss���
�����'��4��4�(�4��;�;�t�$�D��	�� � �M��=�(�D�1�=��K�K�
�6�M�*�� ��� ��rc�P�URRSUR<S3$)N�(�))r�r!r
rYs r�__repr__�DiskRefsContainer.__repr__ss$���.�.�)�)�*�!�D�I�I�=��:�:rc���[5nURU5n[R"U5H�upEnU[	U5Sn[R
RS:wa>UR[R"[R
R5S5nURS5nUHKnSRU(aU/O/U/-5n	[US-U	-5(dM:URU	5 MM M� UR5HGn
U
RU5(dMURU
[	U5SRS55 MI U$)N�/r4)ri�refpathr�walkr-r
�sep�replacer	r�rnr>rlrXr+)rrerjr
�root�unused_dirs�files�dir�filenamer1r�s           rrj�DiskRefsContainer.subkeysvs���%���|�|�D�!��(*����
�$�D�u��s�4�y�{�#�C��w�w�{�{�c�!��k�k�"�+�+�b�g�g�k�k�":�D�A���)�)�D�/�C�!���)�)�c�c�U�r�h�Z�$G�H��$�D�4�K�'�$9�:�:��K�K��(�"�)6��'�'�)�C��~�~�d�#�#����C��D�	��,�2�2�4�8�9�*��rc���[5n[RRUR	[
55(aUR
[
5 UR	S5nUR	S5n[R"U5H�upEnU[U5Sn[RRS:wa>UR[R"[RR5S5nUH8nSRXx/5n	[U	5(dM'UR
U	5 M: M� URUR55 U$)Nr�refsrr4)rirr
�existsrr�rlrr-rrr	rnr>r�rX)
rrwr
�refspathrrrrrr1s
          rrw�DiskRefsContainer.allkeys�s����%��
�7�7�>�>�$�,�,�w�/�0�0��K�K�� ��|�|�C� ���<�<��(��(*����(9�$�D�u��s�4�y�{�#�C��w�w�{�{�c�!��k�k�"�+�+�b�g�g�k�k�":�D�A��!���)�)�S�O�4��#�G�,�,��K�K��(�"�	):�	���t�+�+�-�.��rc�v�[RRS:wa>URS[R"[RR55nU[
:Xa*[RR
URU5$[RR
URU5$)zReturn the disk path of a ref.rr4)rr
rrr	r�rnrrbs  rr�DiskRefsContainer.refpath�sp��
�7�7�;�;�#���<�<��b�k�k�"�'�'�+�+�&>�?�D��7�?��7�7�<�<�� 2� 2�D�9�9��7�7�<�<��	�	�4�0�0rc��URGc0Ul0Ul[RR	URS5n[US5nU [[U55R5nURS5(aASU;a;[U5H+upEnX@RU'U(dMX`RU'M- O3URS5 [U5HupEX@RU'M SSS5 UR$UR$![a 0s$f=f!,(df   UR$=f)rWN�packed-refs�rbs# pack-refss peeledr)rr
rr
rnr
�FileNotFoundError�nextrzr.r+�read_packed_refs_with_peeled�seek�read_packed_refs)rr
r��
first_liner�rSr�s       rrX�!DiskRefsContainer.get_packed_refs�s(�����$�!#�D�� "�D���7�7�<�<��	�	�>�:�D�
��D�$�'���!�$�q�'�]�1�1�3�
��(�(��8�8�Z�:�=U�-I�!�-L�)��6�25�)�)�$�/�!�6�6<�-�-�d�3�.M�
�F�F�1�I�%5�a�%8�	��25�)�)�$�/�&9��� � � �t� � � ��%�
��	�
����� � � �s&�D#�A#D5�=AD5�#D2�1D2�5
Er[c�V�U(dg[RRURS5n[US5nUR	5R5nUR
5HrupVU[:Xa[S5e[[5 [R"URU55 SSS5 UbXdU'M`URUS5 Mt [X4UR5 X@lSSS5 g!,(df   NR=f!,(df   g=f)r]Nr(�wbzcannot pack HEAD)rr
rnr
rX�copyrkr�r/r�OSErrorrorr��write_packed_refsr
r)rr[r
r��packed_refsr�targets       rr^�!DiskRefsContainer.add_packed_refs�s������w�w�|�|�D�I�I�~�6��
�T�4�
 �A��.�.�0�5�5�7�K�'�~�~�/����'�>�$�%7�8�8�
�g�&��I�I�d�l�l�3�/�0�'��%�'-��$��O�O�C��.� 0� 
�a�d�.?�.?�@� +��-!�
 �'�&��!�
 �s%�AD�&D	�=AD�	
D�D�
D(c��UR5 URbXR;agXR;aURU$X$ra)rXr
rrbs  rrc�DiskRefsContainer.get_peeled�sQ��	
�������$��4E�4E�(E���$�$�$��$�$�T�*�*��:�rc��URU5n[US5nUR[[55nU[:Xa/U[[
U55RS5-sSSS5 $XCRS[[5-
5-sSSS5 $!,(df   g=f![[4a gf=f)a`Read a reference file and return its contents.

If the reference file a symbolic reference, only read the first line of
the file. Otherwise, only read the first 40 bytes.

Args:
  name: the refname to read, relative to refpath
Returns: The contents of the ref file, or None if the file does not
    exist.

Raises:
  IOError: if any other error occurs
r)r*N�()
rr
�readr-r,r+rzr.r4�UnicodeError)rrSrr��headers     rr�� DiskRefsContainer.read_loose_ref�s����<�<��%��
	���4�(�A�����F��,���V�#�!�D��a��M�$8�$8��$A�A�	)�(�"�F�F�2��F��+;�$<�<�)�(�(����&�	��		�s;�B4�AB#�-	B4�7"B#�	B4�#
B1�-B4�1B4�4C�Cc�.�URcg[RRURS5n[	US5nSUlUR5 XR;aUR
5 gURU	[[5 URU	SSS5 [X0RUR5 UR5 UR
5 g!,(df   NO=f!UR
5 f=f)Nr(r2)rrr
rnr
rX�abortrrpr
r5�close)rrSrr�s    r�_remove_packed_ref�$DiskRefsContainer._remove_packed_refs������$���7�7�<�<��	�	�>�:���H�d�#��
	� $�D��� � �"��,�,�,��
�G�G�I�
�!�!�$�'��(�#��%�%�d�+�$��a�!2�!2�D�4E�4E�F�
�G�G�I�
�G�G�I�$�#��

�G�G�I�s*�&D�>D�C1�(8D�1
C?�;D�Dc
�j�URU5 URU5 URU5n[US5nUR[U-S-5 URU5Sn	UR
UU	U	UUUUS9 UR5 g![a UR5 ef=f)z�Make a ref point at another ref.

Args:
  name: Name of the ref to set
  other: Name of the ref to point at
  message: Optional message to describe the change
r2�
r6r�N)
r�rr
�writer,r�rNrC�
BaseExceptionrB)
rrSrTrJrKrLrMrr�r�s
          rrR�"DiskRefsContainer.set_symbolic_ref/s��� 	
���D�!����E�"��<�<��%���H�d�#��	�
�G�G�F�U�N�U�*�+��+�+�d�#�B�'�C��I�I����#�#�!��
�
�
�G�G�I��	�	�
�G�G�I��	�s
�AB�B2c���URU5 URU5up�USn
URU
5n[RRU
5nUR5n
U(aFU
RUS5b[U5e[RRU5nU(aMF[[RRU55 [US5nUbYURU
5nUc$UR5RU
[5nX�:waUR!5 SSS5 gUR%US-5 UR'U
UUUUUUS9 SSS5 g![[[4a Un
GNkf=f!["a UR!5 ef=f!["a UR!5 ef=f!,(df   g=f)a�Set a refname to new_ref only if it currently equals old_ref.

This method follows all symbolic references, and can be used to perform
an atomic compare-and-swap operation.

Args:
  name: The refname to set.
  old_ref: The old sha the refname must refer to, or None to set
    unconditionally.
  new_ref: The new sha the refname will refer to.
  message: Set message for reflog
Returns: True if the set was successful, False otherwise.
r6Nr2FrGr�T)r�r�rp�
IndexErrorrrrr
�dirnamerXr��NotADirectoryErrorrr
r�rrBr4rHrN)rrSr�r�rJrKrLrMr�r�r�r�	probe_refr6r��orig_refs                rrm�DiskRefsContainer.set_if_equalsUs���.	
���D�!�	��;�;�t�,�L�I� ��}�H��<�<��)���G�G�O�O�H�-�	��*�*�,������y�$�/�;�(��2�2������	�2�I��i�
	�"�'�'�/�/�(�3�4�
�X�t�
$���"�
�#�2�2�8�<�H��'�#'�#7�#7�#9�#=�#=�h��#Q���*����	�$�%�
$�+�
�����%��(�
�I�I����#�#�!��
�
�%%�6��Q�*�j�1�	��H�	��.���G�G�I����
�
����	��
��%�
$�6�sN�E<�,G�1A
F�G�
F9�G�<F�F�F6�6G�9G�G�
G&rSrrMc��URU5upxUbgUSn	URU	5 UR	U	5n
[[RRU
55 [U
S5n[RRU
5(dXR5;aUR5 SSS5 gURUS-5 URUSUUUUUS9 SSS5 g![[4a Un	N�f=f![a UR5 ef=f!,(df   g=f)aGAdd a new reference only if it does not already exist.

This method follows symrefs, and only ensures that the last ref in the
chain does not exist.

Args:
  name: The refname to set.
  ref: The new sha the refname will refer to.
  message: Optional message for reflog
Returns: True if the add was successful, False otherwise.
NFr6r2rGr�T)r�rprLr�rrrr
rMr
r"rXrBrHrNr4)rrSrrJrKrLrMr�r(r�rr�s            rr��DiskRefsContainer.add_if_new�s*��(	�"&�+�+�d�"3��I��#�� ��}�H�	
���H�%��<�<��)���"�'�'�/�/�(�3�4�
�X�t�
$���w�w�~�~�h�'�'�4�3G�3G�3I�+I����	��%�
$�
�����e��$�
�	�	����'�'�%�#���%�&��1�*�%�	��H�	���
����	��
��
%�
$�&�s;�C:�C:�4A	D1�D�D1�:D�D�D.�.D1�1
D?c
�\�URU5 URU5n[[RRU55 [
US5nUbOURU5n	U	c$UR5RU[5n	X�:waUR5 g[RRU5n
U
(a[R"U5 URU5 UR!UUSUUUUS9 UR5 UnUR#SS5up�US:XagURU5n
[R&"U
5 MG![a Sn
N�f=f!UR5 f=f![$a gf=f![a gf=f)	a�Remove a refname only if it currently equals old_ref.

This method does not follow symbolic references. It can be used to
perform an atomic compare-and-delete operation.

Args:
  name: The refname to delete.
  old_ref: The old sha the refname must refer to, or None to
    delete unconditionally.
  message: Optional message
Returns: True if the delete was successful, False otherwise.
r2NFr�Tr4rr!)r�rrrr
rMr
r�rXr�rrB�lexistsr4rorDrN�rsplitr/�rmdir)rrSr�rJrKrLrMrr�rP�found�parentr��parent_filenames              rrq�"DiskRefsContainer.remove_if_equals�s���*	
���D�!��<�<��%���"�'�'�/�/�(�3�4��H�d�#��	��"��.�.�t�4���#�#�3�3�5�9�9�$��I�H��&� �0
�G�G�I�+
�������1��
��	�	�(�#��#�#�D�)��I�I����#�#�!��
�
�
�G�G�I�
���
�"�M�M�$��2�	���� ���#�l�l�6�2�O�
�����)���3�
���
��&
�G�G�I���
���
���
�
��
�sV�AE9�+E'�
AE9�!F�F�'E6�3E9�5E6�6E9�9F�
F�F�
F+�*F+)rr
r
r)NNrr�)r!r"r#r$r%r�strrrjrwrrXr�r�rr
r^rcr�rDrRr�rmr�r�rqr&r�r�s@rrrcs���3�!�!�;�#�;��&�"	1�!�@",��S�(�8�2D�-D�(E�",�$�",�H�&�<�2����$�
�$�V����C�
�C�R���#'�1��1��1��%��1�
�1�n����O�
�O�Orrc��URS5RS5n[U5S:wa[SU<35eUup#[	U5(d[SU<35e[U5(d[SU<35eX#4$)z6Split a single ref line into a tuple of SHA1 and name.s

� �zinvalid ref line �Invalid hex sha zinvalid ref name )r.�splitr-rrr>)�line�fieldsr�rSs    r�_split_ref_linerds���
�[�[��
!�
'�
'��
-�F�
�6�{�a��!�$5�d�X�">�?�?��I�C�����!�$4�S�G�"<�=�=��D�!�!�!�$5�d�X�">�?�?��;�rc#�# �UHInURS5(aMURS5(a[S5e[U5v� MK g7f)z{Read a packed refs file.

Args:
  f: file-like object to read from
Returns: Iterator over tuples with SHA1s and ref names.
�#�^z.found peeled ref in packed-refs without peeledN)r+rrd)r�rbs  rr.r.,sI������?�?�4� � ���?�?�4� � �%�&V�W�W��d�#�#�
�s�AAc#�# �SnUH�nUSS:XaMURS5nURS5(aQU(d[S5e[USS5(d[SUSS<35e[	U5up4SnX4USS4v� M�U(a[	U5up4X4S4v� UnM� U(a[	U5up4X4S4v� gg7f)	z�Read a packed refs file including peeled refs.

Assumes the "# pack-refs with: peeled" line was already read. Yields tuples
with ref names, SHA1s, and peeled SHA1s (or None).

Args:
  f: file-like object to read from, seek'ed to the second line
Nrrfr*rgzunexpected peeled ref linerr`)r.r+rrrd)r��lastrbr�rSs     rr,r,<s�����D�����7�d�?���{�{�7�#���?�?�4� � ��)�*F�G�G���Q�R��)�)�)�,<�T�!�"�X�L�*I�J�J�'��-�I�C��D��d�1�2�h�'�'��+�D�1�	���$�'�'��D�!�"�#�D�)�	���$����s�CC	c���Uc0nOURS5 [UR55H@nUR[XU55 X2;dM'URSX#-S-5 MB g)z�Write a packed refs file.

Args:
  f: empty file-like object to write to
  packed_refs: dict of refname to sha of packed refs to write
  peeled_refs: dict of refname to peeled value of sha
Ns# pack-refs with: peeled
rgrG)rH�sortedr~r)r�r6�peeled_refsr1s    rr5r5\si������	���-�.��+�*�*�,�-��	�����-�w�7�8��!�
�G�G�D�;�/�/�%�7�8�.rc��0nUR5H*nURS5RSS5up4X1U'M, U$)Nr*�	r)�	readlinesr.ra)r�r�rbr�rSs     rr�r�nsB��
�C����
���k�k�'�*�0�0���:����D�	���Jr�storec#�V# �SSKJn [UR55Hqup4U[:XaMXnU"X5upgURS-U-S-v� URUR:wdMSURS-U-[-S-v� Ms g![
a M�f=f7f)zGenerate info refs.r��peel_sharnrGN)�object_storersrkrkr�rp�id�PEELED_TAG_SUFFIX)r�rprsrSr��o�unpeeledr�s        r�write_info_refsryvs����'��D�J�J�L�)�	���7�?��	��
�A�$�E�/����d�d�U�l�T�!�E�)�)��4�4�6�9�9���)�)�e�#�d�*�->�>��F�F�*���	��	�s-�1B)�B�9B)�5#B)�
B&�"B)�%B&�&B)c�,�UR[5$r)r+�LOCAL_BRANCH_PREFIX)�xs r�is_local_branchr}�s���<�<�+�,�,rc��UR5VVs0sH#upUR[5(aM!X_M% snn$s snnf)zRemove all peeled refs.)rkr;rv)r�rr�s   r�strip_peeled_refsr�s=��$(�:�:�<��#/�Z�c�s�|�|�DU�7V����<����s
� A�Ac��0n0nUR5H:up4UR[5(aXAUS[[5*'M6XBU'M< X!4$)z$Split peeled refs from regular refs.N)rkr;rvr-)r�r��regularrr�s     rr�r��sX��
�F��G��J�J�L����<�<�)�*�*�58�3�0�#�/�0�0�1�2��C�L�	!�
�?�rc���SU-S-nU(aPUR[5(a5U[-nX2[[5S-nXP;aUR	XE5 gggg)Nrr4)r+r{r�r-rR)r��origin�origin_head�origin_base�
origin_ref�
target_refs      r�_set_origin_headr��sf��"�V�+�d�2�K��{�-�-�.A�B�B� �7�*�
� �s�3F�/G�/I�#J�J�
����!�!�*�9��C�{rr�r�r��branch�ref_messagec���SU-S-nU(afXS-nX`;a"[U-nURXpUU5 UnU$[U-U;a[U-nU$[[R
"U5<S35eU(aKUnUR
[5(aXR[[5S-nOUnURX�UU5 U$[S5e![a U$f=f)zSet the default branch.rr4z is not a valid branch or tagNz+neither origin_head nor branch are provided)	r{r��LOCAL_TAG_PREFIXr/rr	r+r-rp)	r�r�r�r�r�r�r��	local_ref�head_refs	         r�_set_default_branchr��s	��#�V�+�d�2�K�
� �)�
���+�f�4�I��O�O�I�J�'7��E� �H�"�O�!��
&�$�
.�'�&�0�H��O�����F� 3�6�6S�T�U�U�	����!�!�"5�6�6�$�3�7J�3K�3M�'N�N�J�$�J�	��O�O�H�:�&6��D�
�O��F�G�G���	���O�		�s�1C�
C!� C!c��UR[5(a`Xn[U[5(a)URupEURU5RnU[	UR[SX2S9 U$XnUR[U5 UR[SX2S9 U$![a SnU$f=f)Nrh)r+r��
isinstancer�object�
get_objectrur�rmrRrp)r�r�r��head�_cls�objs      r�	_set_headr��s������+�,�,��~���d�C� � ����I�D��>�>�#�&�)�)�D���M����7�D�$��D��K�
	��>�D��!�!�'�8�4����w��d��H��K���	��D��K�	�s�</B-�-B=�<B=�refs_container�remote_namerMrf�
prune_tagsc��[U5nUR5VVs0sH4upxUR[5(dM!U[	[5SU_M6 n	nnURSUR
5-U	UUS9 UR5VVs0sHPupxUR[5(dM!UR[5(aM=U[	[5SU_MR n
nnUR[X�US9 gs snnfs snnf)Nr)rMrf)
rrkr+r{r-rtrr�r;rv)r�r�r�rMrfr��
stripped_refs�n�v�branches�tagss           r�_import_remote_refsr��s��&�d�+�M�$�)�)�+��+�F�Q��<�<�+�,�	)��#�!�
"�
$�%�q�(�+�
��
����;�-�-�/�/����	��$�)�)�+��+�F�Q��<�<�(�)�	&�23�*�*�=N�2O�	&��#��
�
!�"�A�%�+�	��
����$�z����!��s� D�D� D	�7D	�D	c
��SSKJn 0nUR5HHupEU"X5upg[U[5(aUR
X4[-'UR
X4'MJ U$![aN [R"SRURSS5URS55[5 M�f=f)Nrrrz#ref {} points at non-present sha {}zutf-8r�ascii)
rtrsrkr�rrurvrp�warnings�warn�format�decode�UserWarning)rpr�rsr�rr�rxr�s        r�serialize_refsr��s���&�
�C��J�J�L���
	#�'��3��H��(�C�(�(�/5�y�y��+�+�,��{�{�C�H�!��J���	��M�M�5�<�<��J�J�w�	�2�C�J�J�w�4G���	
�
�	�s�
A'�'AB?�>B?rr)NFF)<r%rr��collections.abcr�
contextlibr�typingrr�errorsrr	�filer
r�objectsrr
rrr�packrr�r�r�r,r{r��LOCAL_REMOTE_PREFIXrir:rv�ANNOTATED_TAG_SUFFIX�	Exceptionrr0r�r>r@r�r�rrdr.r,r5r�ryr}rr�r�r�r�r\r�r�r�r'rr�<module>r�s���.�	��$�� �7�,�D�D�!���
��	��$�� ��&���N�#�
���)�����	��	�5�	��c��d��DN�N�b
N$�
�N$�b$�
�$�2y�
�y�x
�
$�  �@9�$�G��G�(-��	�:��
�����%���
�	�
�%����
�D�0 $���
�!�����s�C�x�.���e�_�	�
���
�
��<r

Youez - 2016 - github.com/yon3zu
LinuXploit