403Webshell
Server IP : 50.21.180.56  /  Your IP : 216.73.216.139
Web Server : Apache
System : Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User : ws67922704 ( 67922704)
PHP Version : 8.5.13
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  /kunden/proc/self/root/usr/lib/python3/dist-packages/dulwich/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /kunden/proc/self/root/usr/lib/python3/dist-packages/dulwich/__pycache__/index.cpython-313.pyc
�

mEdg]���V�SrSSKrSSKrSSKrSSKrSSKJrJr SSKJ	r	 SSK
Jr SSKJ
r
JrJrJrJr SSKJr SS	KJr SS
KJrJrJrJrJrJrJr SSKJrJ r J!r! Sr"S
r#Sr$Sr%Sr&Sr'Sr(Sr)"SS\5r*\	"SS55r+\	"SS55r,"SS5r-"SS\.5r/S\0S\1\0\044Sjr2S r3S!r4SeS"jr5S#\6S\+4S$jr7S%\+S#\6SS4S&jr8"S'S(\.5r9S)\S\\+4S*jr:S\;\0\\,\-444S+jr<SfS)\S,\=\+S#\\6SS4S-jjr>SfS)\S,\;\0\\,\-44S#\\6SS4S.jjr?S/\6S\64S0jr@"S1S25rAS3\S4\\1\0\0\64S\04S5jrBS3\S6\AS\04S7jrCSgS8\\0S9\\0/\1\0\644S3\S:\\0S\\1\1\\0\\04\1\\6\\64\1\\0\\0444
S;jjrDSfS<\0S/\\64S=jjrE\R�S>:Xa"S?S@\G5rHSgSSA.SBjjrIO\R�rISCSDSSE.SF\S/\6SG\04SHjjrJSIrKSJ\0S\L4SKjrMSJ\0S\L4SLjrN\M4S\0S\L4SMjjrOSC\MS4SN\\P\04SO\\P\04S3\SP\0SQ\LSS4SRjjrQShSS\0S/\64STjjrRShSS\04SUjjrSS\\P\04S\\04SVjrTSW\0S\L4SXjrUSfS6\ASN\\P\044SYjjrV\R�R�SZ5rYSN\0SW\04S[jrZSS\\P\04S\04S\jr[S\0S\\,4S]jr\SfS\0S3\\S\\,4S^jjr]SfS_\\0SN\0S3\\S\\1\0\\,44S`jjr^SiS_\\0SN\0S\\1\0\\0\\644Sajjr_S6\ASN\0SS4Sbjr`"ScSd5rag)jz%Parser for the git index file format.�N)�Iterable�Iterator)�	dataclass)�Enum)�Any�BinaryIO�Callable�Optional�Union�)�GitFile)�iter_tree_contents)�S_IFGITLINK�S_ISGITLINK�Blob�ObjectID�Tree�
hex_to_sha�
sha_to_hex)�ObjectContainer�
SHA1Reader�
SHA1Writeri0�i�i�i@i �c�$�\rSrSrSrSrSrSrSrg)�Stage�Hrrr��N)	�__name__�
__module__�__qualname__�__firstlineno__�NORMAL�MERGE_CONFLICT_ANCESTOR�MERGE_CONFLICT_THIS�MERGE_CONFLICT_OTHER�__static_attributes__r��//usr/lib/python3/dist-packages/dulwich/index.pyrrHs��
�F������r)rc���\rSrSr%\\S'\\\\	\\44\S'\\\\	\\44\S'\\S'\\S'\\S'\\S'\\S	'\\S
'\\S'\\S'\\S
'S\
4SjrSrg)�SerializedIndexEntry�O�name�ctime�mtime�dev�ino�mode�uid�gid�size�sha�flags�extended_flags�returnc�H�[UR[-[-	5$�N)rr8�FLAG_STAGEMASK�FLAG_STAGESHIFT��selfs r*�stage�SerializedIndexEntry.stage^s���d�j�j�>�1�o�E�F�Fr)rN)
r r!r"r#�bytes�__annotations__r�int�float�tuplerrAr(rr)r*r,r,Osw��
�K���e�U�3��8�_�,�-�-���e�U�3��8�_�,�-�-�	�H�	�H�

�I�	�H�	�H�

�I�	�J��J���G�u�Gr)r,c���\rSrSr%\\\\\\44\S'\\\\\\44\S'\\S'\\S'\\S'\\S'\\S'\\S	'\	\S
'\
S\SS4S
j5rS\	S\
S\4SjrSrg)�
IndexEntry�br/r0r1r2r3r4r5r6r7�
serializedr:c���U"URURURURURUR
URURURS9	$)N�	r/r0r1r2r3r4r5r6r7rM)�clsrKs  r*�from_serialized�IndexEntry.from_serializednsR����"�"��"�"����������������������

�
	
r)r.rAc��[UURURURURUR
URURURURUR[-SS9$)Nr)r.r/r0r1r2r3r4r5r6r7r8r9)r,r/r0r1r2r3r4r5r6r7�valuer>)r@r.rAs   r*�	serialize�IndexEntry.serialize|s`��#���*�*��*�*�����������������������+�+��0��

�
	
r)rN)r r!r"r#rrErFrGrDrC�classmethodr,rOrrSr(rr)r*rIrIbs�����e�U�3��8�_�,�-�-���e�U�3��8�_�,�-�-�	�H�	�H�

�I�	�H�	�H�

�I�	�J��
�)=�
�,�
��
�
�e�
�E�
�6J�
r)rIc	��\rSrSr%Sr\\\S'\\\S'\\\S'S
S\\S\\S\\SS4SjjrS	r	g)�ConflictedIndexEntry�z'Index entry that represents a conflict.�ancestor�this�otherNr:c�(�XlX lX0lgr<)rYrZr[)r@rYrZr[s    r*�__init__�ConflictedIndexEntry.__init__�s��!�
��	��
r))rYr[rZ)NNN)
r r!r"r#�__doc__r
rIrDr]r(rr)r*rWrW�sp��1��z�"�"�
�:�
���J���*.�%)�&*�	��:�&���z�"���
�#�	�

��r)rWc��\rSrSrSrSrg)�UnmergedEntries�z$Unmerged entries exist in the index.rN)r r!r"r#r_r(rr)r*rara�s��.r)ra�pathr:c�Z�URSS5upX4$![a SU4s$f=f)z�Split a /-delimited path into a directory part and a basename.

Args:
  path: The path to split.

Returns:
  Tuple with directory name and basename
�/rr))�rsplit�
ValueError)rc�dirname�basenames   r*�	pathsplitrj�s@��#�"�k�k�$��2����"�"�����T�{���s��*�*c�`�SRUVs/sH
o(dMUPM sn5$s snf)zJoin a /-delimited path.re)�join)�args�ps  r*�pathjoinro�s%���9�9��+��A��a��+�,�,��+s�
+�+c�N�[R"SURS55$)zkRead a cache time.

Args:
  f: File-like object to read from
Returns:
  Tuple with seconds and nanoseconds
�>LL�)�struct�unpack�read)�fs r*�read_cache_timerw�s���=�=�����q�	�*�*r)c�>�[U[5(aUS4nO][U[5(a([US5up#[U5[US-54nO [U[5(d[U5eUR
[R"S/UQ765 g)z}Write a cache time.

Args:
  f: File-like object to write to
  t: Time to write (as int, float or tuple with secs and nsecs)
rg�?iʚ;rqN)	�
isinstancerErF�divmodrG�	TypeError�writers�pack)rv�t�secs�nsecss    r*�write_cache_timer��s}���!�S���
��F��	�A�u�	�	��q�#��
��
��Y��E�J�.�/�0��
��5�
!�
!���l���G�G�F�K�K��"��"�#r)�versionc�D�UR5n[U5n[U5n[R"SUR	S55unnnnn	n
nnU[
-(a:US:a[
S5e[R"SUR	S55un
OSn
UR	U[-5nUS:a=UR5U-
S	-S
-nUR	X/-UR5-
5 [UUUUUUUU	U
[U5U[)-U
5$)zKRead an entry from a cache file.

Args:
  f: File-like object to read from
z>LLLLLL20sH�.rz+extended flag set in index with version < 3z>Hrr�rr���)
�tellrwrsrtru�
FLAG_EXTENDED�AssertionError�
FLAG_NAMEMASKr,r)rvr��beginoffsetr/r0r1r2r3r4r5r6r7r8r9r.�	real_sizes                r*�read_cache_entryr��s���&�&�(�K��A��E��A��E�	�
�
�m�Q�V�V�N�%;�<�	��������
��}���Q�;� �!N�O�O�"�M�M�$����q�	�:������6�6�%�-�'�(�D���{��V�V�X��+�a�/�2�5�	�	����'�1�6�6�8�3�4���
�
��������3��
�����
�
r)�entryc��UR5n[XR5 [XR5 [	UR
5UR[)--nUR(a	U[-nU[-(aUbUS:a[S5eUR[R"SURS-URS-UR UR"UR$UR&[)UR*5U5	5 U[-(a0UR[R"SUR55 URUR
5 US:aAUR5U-
S-S	-nURS
X5-UR5-
-5 gg)zbWrite an index entry to a file.

Args:
  f: File object
  entry: IndexEntry to write, tuple with:
Nrz+unable to use extended flags in version < 3s>LLLLLL20sHl��s>Hr�rrr��)r�r�r/r0�lenr.r8r�r9r�r�r|rsr}r1r2r3r4r5r6rr7)rvr�r�r�r8r�s      r*�write_cache_entryr�sP���&�&�(�K��Q���$��Q���$���
�
�O�u�{�{�m�^�;�<�E����
�����}���!4��1���J�K�K��G�G������I�I�
�"��I�I�
�"��J�J��I�I��I�I��J�J��u�y�y�!��
	
��
�}��	������E�5�#7�#7�8�9��G�G�E�J�J����{��V�V�X��+�a�/�2�5�	�	����+�1�Q�V�V�X�=�>�?�r)c�"�\rSrSrSrSSjrSrg)�UnsupportedIndexFormati'z,An unsupported index format was encountered.Nc��Xlgr<��index_format_version)r@r�s  r*r]�UnsupportedIndexFormat.__init__*s��$+�!r)r��r:N)r r!r"r#r_r]r(rr)r*r�r�'s
��6�,r)r�rvc#�# �URS5nUS:wa[SU<35e[R"SURS55up#US;a[	U5e[U5Hn[
X5v� M g7f)z4Read an index file, yielding the individual entries.r��DIRCzInvalid index file header: �>LLrr)rrrN)rur�rsrtr��ranger�)rv�headerr��num_entries�is     r*�
read_indexr�.su���
�V�V�A�Y�F�
����:�6�*�E�F�F�#�]�]�6�1�6�6�%�=�A��W��i��$�W�-�-�
�;�
���q�*�*� �s�BBc��0n[U5GH/nUR5nU[R:Xa#[RU5XR'MKURUR[55n[U[5(a[SUR<S35eU[R:Xa[RU5UlM�U[R:Xa[RU5UlM�U[R:XdGM[RU5UlGM2 U$)z�Read an index file and return it as a dictionary.
   Dict Key is tuple of path and stage number, as
        path alone is not unique
Args:
  f: File object to read fromls.
zNon-conflicted entry for z exists)r�rArr$rIrOr.�
setdefaultrWryr�r%rYr&rZr'r[)rv�retr�rA�existings     r*�read_index_dictr�:s���AC�C��A������
���E�L�L� �(�8�8��?�C�
�
�O��~�~�e�j�j�2F�2H�I�H��(�J�/�/�$�'@�����g�%V�W�W���5�5�5�$.�$>�$>�u�$E��!��%�3�3�3� *� :� :�5� A��
��%�4�4�4�!+�!;�!;�E�!B�����Jr)�entriesc	���Uc[nURS5 UR[R"SU[	U555 UHn[XU5 M g)z�Write an index file.

Args:
  f: File-like object to write to
  version: Version number to write
  entries: Iterable over the entries to write
Nr�r�)�DEFAULT_VERSIONr|rsr}r�r�)rvr�r�r�s    r*�write_indexr�SsK����!���G�G�G���G�G�F�K�K����W��6�7����!�G�,�r)c��/n[U5GH"nXn[U[5(a�URb9UR	URRU[R55 URb9UR	URRU[R55 URb;UR	URRU[R55 M�M�UR	URU[R55 GM% [XUS9 g)zlWrite an index file based on the contents of a dictionary.
being careful to sort by path and then by stage.
N�r�)�sortedryrWrY�appendrSrr%rZr&r[r'r$r�)rvr�r��entries_list�keyrRs      r*�write_index_dictr�es����L��g�������e�1�2�2��~�~�)��#�#��N�N�,�,�S�%�2O�2O�P���z�z�%��#�#��J�J�(�(��e�.G�.G�H���{�{�&��#�#��K�K�)�)�#�u�/I�/I�J��'�

�������U�\�\� B�C�!�"���1r)r3c�"�[R"U5(a[R$[R"U5(a[R$[U5(a[$[RS-nUS-(aUS-nU$)z�Cleanup a mode value.

This will return a mode that can be stored in a tree object.

Args:
  mode: Mode to clean up.

Returns:
  mode
i��@�I)�stat�S_ISLNK�S_IFLNK�S_ISDIR�S_IFDIRrr�S_IFREG)r3r�s  r*�cleanup_moder��sj���|�|�D����|�|��	
���d�	�	��|�|��	�T�	�	���
�,�,��
�C��e�|��u����Jr)c��\rSrSr%Sr\\\\\	44\
S'S%S\\\4SS4Sjjr\
S5rS\4S	jrS&S
jrS&SjrS\4SjrS
\S\\\	44SjrS\\4SjrS\4SjrS\S\4SjrS\S\4SjrS\\\\\44SjrS\4SjrS&SjrS\S\\\	4SS4Sjr S\SS4Sjr!S\\\\\\	444Sjr"S\\\\\\	444Sjr#S\\\\\	44SS4Sjr$Sr%S'S \&S!\4S"jjr'S#r(S$r)g)(�Indexi�zA Git Index file.�_byname�filenamer:Nc�n�XlSUlUR5 U(aUR5 gg)z�Create an index object associated with the given filename.

Args:
  filename: Path to the index file
  read: Whether to initialize the index from the given file, should it exist.
N)�	_filename�_version�clearru)r@r�rus   r*r]�Index.__init__�s*��"����
��
�
����I�I�K�r)c��UR$r<)r�r?s r*rc�
Index.path�s���~�~�r)c�P�URRSUR<S3$)N�(�))�	__class__r r�r?s r*�__repr__�Index.__repr__�s%���.�.�)�)�*�!�D�N�N�+=�Q�?�?r)c���[URS5n[U5n[XRUR
S9 UR
5 g!UR
5 f=f)z(Write current contents of index to disk.�wbr�N)r
r�rr�r�r��close�r@rvs  r*r|�Index.write�sE���D�N�N�D�)��	��1�
�A��Q���d�m�m�D�
�G�G�I��A�G�G�I�s�)A�A$c���[RRUR5(dg[	URS5n[U5nUR
[U55 UR[RRUR5UR5-
S-
5 UR5 UR5 g!UR5 f=f)z)Read current contents of index from disk.N�rb�)
�osrc�existsr�r
r�updater�ru�getsizer��	check_shar�r�s  r*ru�
Index.read�s����w�w�~�~�d�n�n�-�-���D�N�N�D�)��	��1�
�A��K�K���*�+�
�F�F�2�7�7�?�?�4�>�>�2�Q�V�V�X�=��B�C�
�K�K�M�
�G�G�I��A�G�G�I�s
�BC�C+c�,�[UR5$)z%Number of entries in this index file.)r�r�r?s r*�__len__�
Index.__len__�s���4�<�<� � r)r�c� �URU$)z�Retrieve entry by relative path and stage.

Returns: Either a IndexEntry or a ConflictedIndexEntry
Raises KeyError: if the entry does not exist
�r��r@r�s  r*�__getitem__�Index.__getitem__�s���|�|�C� � r)c�,�[UR5$)z0Iterate over the paths and stages in this index.)�iterr�r?s r*�__iter__�Index.__iter__�s���D�L�L�!�!r)c��XR;$r<r�r�s  r*�__contains__�Index.__contains__�s���l�l�"�"r)rcc�X�Xn[U[5(a[eUR$)z6Return the (git object) SHA1 for the object at a path.)ryrWrar7�r@rcrRs   r*�get_sha1�Index.get_sha1�s'���
���e�1�2�2�!�!��y�y�r)c�X�Xn[U[5(a[eUR$)z4Return the POSIX file mode for the object at a path.)ryrWrar3r�s   r*�get_mode�Index.get_mode�s'���
���e�1�2�2�!�!��z�z�r)c#�# �UHEnXn[U[5(a[eXR[	UR
54v� MG g7f)z=Iterate over path, sha, mode tuples for use with commit_tree.N)ryrWrar7r�r3)r@rcr�s   r*�iterobjects�Index.iterobjects�sB����D��J�E��%�!5�6�6�%�%��	�	�<��
�
�#;�;�;�	���A
Ac�t�URR5Hn[U[5(dM g g)NTF)r��valuesryrW)r@rRs  r*�
has_conflicts�Index.has_conflicts�s/���\�\�(�(�*�E��%�!5�6�6��+�r)c��0Ulg)z$Remove all contents from this index.Nr�r?s r*r��Index.clear�s	����r)r.rRc�N�[U[5(deX RU'gr<)ryrCr�)r@r.rRs   r*�__setitem__�Index.__setitem__�s#���$��&�&�&�&�"���T�r)c��URU	gr<r�)r@r.s  r*�__delitem__�Index.__delitem__s���L�L��r)c�H�[URR55$r<�r�r��itemsr?s r*�	iteritems�Index.iteritemss���D�L�L�&�&�(�)�)r)c�H�[URR55$r<rr?s r*r�Index.itemss���D�L�L�&�&�(�)�)r)r�c�>�UR5H	up#X0U'M gr<)r)r@r�r�rRs    r*r��Index.updates��"�-�-�/�J�C���I�*r)c#�T# �URR5Shv�N gN7fr<)r��keysr?s r*�paths�Index.pathss����<�<�$�$�&�&�&�s�(�&�(�tree�want_unchangedc#�d^# �U4Sjn[TR5UUUUS9Shv�N gN7f)aGFind the differences between the contents of this index and a tree.

Args:
  object_store: Object store to use for retrieving tree contents
  tree: SHA1 of the root tree
  want_unchanged: Whether unchanged files should be reported
Returns: Iterator over tuples with (oldpath, newpath), (oldmode,
    newmode), (oldsha, newsha)
c�P>�TUnUR[UR54$r<)r7r�r3)rcr�r@s  �r*�lookup_entry�-Index.changes_from_tree.<locals>.lookup_entry$s$�����J�E��9�9�l�5�:�:�6�6�6r))rN)�changes_from_treer)r@�object_storerrrs`    r*r�Index.changes_from_trees4����	7�%��J�J�L����)�
�	
�	
�s�%0�.�0c�4�[XR55$)zrCreate a new tree from an index.

Args:
  object_store: Object store to save the tree in
Returns:
  Root tree SHA
��commit_treer�)r@rs  r*�commit�Index.commit0s���<�)9�)9�);�<�<r))r�r�r�)Tr��F)*r r!r"r#r_�dictrCrrIrWrD�strr]�propertyrcr�r|rurEr�r�rr��boolr�r�r�rrGr�r�r�r�r�rrr�rrrrr(rr)r*r�r��s����
�%��z�+?�?�@�@�
A�A���u�c�z�!2��$������@�#�@���!��!�!�u�!��z�;O�/O�)P�!�"�(�5�/�"�#�4�#��U��u���U��s��<�X�e�E�5�#�,=�&>�?�<��t���#��#�"'�
�4H�(H�"I�#�	
�#����$��*�	�%��u�Z�1E�%E�F�F�G�	H�*�
*�x��e�U�:�?S�3S�-T�&T� U�V�*���E�5��5I�)I�#J�J�K��	
��'�DI�
�"*�
�<@�
�2=r)r�r�blobsc�^^^	^
�S00m
UU
4SjmUH up#n[U5upVT"U5nXC4Xv'M" U	UU
4Sjm	T	"S5$)z�Commit a new tree.

Args:
  object_store: Object store to add trees to
  blobs: Iterable over blob path, sha, mode entries
Returns:
  SHA1 of the created tree.
r)c�>�UT;aTU$[U5upT"U5n[U[5(de0nXCU'UTU'U$r<)rjryrC)rcrhrir~�newtree�add_tree�treess     ��r*r%�commit_tree.<locals>.add_treeHsW����5�=���;��%�d�O����W����(�E�*�*�*�*����(����d���r)c�$>�[5nTUR5HRup#[U[5(a"[R
nT"[
X55nOUupEURX$U5 MT TRU5 UR$r<)
rrryrr�r�ro�add�
add_object�id)	rcrrir�r3r7�
build_treerr&s	      ���r*r,�commit_tree.<locals>.build_treeXsv����v��$�T�{�0�0�2�O�H��%��&�&��|�|�� ��$�!9�:��#����H�H�X�S�)�
 3�	����%��w�w�r))rj)rr!rcr7r3�	tree_pathrirr%r,r&s`       @@@r*rr;sS��� #�B�i�E�	�!���4�'��o��	��	�"������!�

��c�?�r)�indexc�4�[XR55$)z�Create a new tree from an index.

Args:
  object_store: Object store to save the tree in
  index: Index file
Note: This function is deprecated, use index.commit() instead.
Returns: Root tree sha.
r)rr/s  r*�commit_indexr1gs���|�%6�%6�%8�9�9r)�namesrrc#�d# �[U5nUbN[X#5H?upgnU"U5up�URU5 U(d
X�:wdX�:waXf4Xz4X�44v� M?MA UHnU"U5up�SU4SU
4SU	44v� M g![a US4US4US44v� Mf=f![a MKf=f7f)a�Find the differences between the contents of a tree and
a working copy.

Args:
  names: Iterable of names in the working copy
  lookup_entry: Function to lookup an entry in the working copy
  object_store: Object store to use for retrieving tree contents
  tree: SHA1 of the root tree, or None for an empty tree
  want_unchanged: Whether unchanged files should be reported
Returns: Iterator over tuples with (oldpath, newpath), (oldmode, newmode),
    (oldsha, newsha)
N)�setr�remove�KeyError)r2rrrr�other_namesr.r3r7�	other_sha�
other_modes           r*rrss����4�e�*�K���1�,�E�O�D��
O�*6�t�*<�'��
�"�"�4�(�!�Y�%5��9K� �<�$�);�c�=M�N�N�:L� F���	H�&2�4�&8�#�Y��$�<�$�
�!3�d�I�5F�G�G�
���
@��d�|�d�D�\�C��;�?�?�
@���	��	�sK� B0�
B�7B0�%
B�/B0�B�B0�B�B0�
B-�)B0�,B-�-B0�hex_shac���Uc[UR5n[URURUR
URUURURURU5	$)z{Create a new index entry from a stat value.

Args:
  stat_val: POSIX stat_result instance
  hex_sha: Hex sha of the object
)
r��st_moderI�st_ctime�st_mtime�st_dev�st_ino�st_uid�st_gid�st_size)�stat_valr:r3s   r*�index_entry_from_statrE�sc���|��H�,�,�-��������������������������
�
r)�win32c�,^�\rSrSrSU4SjjrSrU=r$)�WindowsSymlinkPermissionErrori�c�6>�[[U]USU3U5 g)Nz>Unable to create symlink; do you have developer mode enabled? )�super�PermissionErrorr])r@�errno�msgr�r�s    �r*r]�&WindowsSymlinkPermissionError.__init__�s'����/�4�1��7�7:�e�=��	
r)rr�)r r!r"r#r]r(�
__classcell__)r�s@r*rHrH�s
���	�	r)rH)�dir_fdc��[R"XX#S9$![a1n[URUR
UR5UeSnAff=f)N)�target_is_directoryrP)r��symlinkrKrHrL�strerrorr�)�src�dstrRrP�es     r*rSrS�sQ��	X��:�:��.A��
���	X�/�������Q�Z�Z�P�VW�W��	X�s��
A�,A
�
AT�utf-8)�honor_filemode�
tree_encoding�
symlink_fn�blob�target_pathc��[R"U5nUR5n[R
"U5(aiU(a[R"U5 [RS:Xa"URU5nURU5nU=(d ["Xr5 O�UbNUR[U5:Xa5[US5nUR5U:XaUsSSS5 $SSS5 [US5nURU5 SSS5 U(a[R "X!5 [R"U5$![a SnGNMf=f!,(df   Nz=f!,(df   Ne=f)aeBuild a file or symlink on disk based on a Git object.

Args:
  blob: The git object
  mode: File mode
  target_path: Path to write to
  honor_filemode: An optional flag to honor core.filemode setting in
    config file, default is core.filemode=True, change executable bit
  symlink: Function to use for creating symlinks
Returns: stat object for the file
NrFr�r�)r��lstat�FileNotFoundError�
as_raw_stringr�r��unlink�sys�platform�decoderSrCr��openrur|�chmod)	r\r3r]rYrZr[�oldstat�contentsrvs	         r*�build_file_from_blobrj�s&��(��(�(�;�'���!�!�#�H��|�|�D�����I�I�k�"��<�<�7�"����}�5�H�%�,�,�]�;�K�	�	�w�	��6���7�?�?�c�(�m�#C��k�4�(�A��6�6�8�x�'�"�)�(�'�)��+�t�
$��
�G�G�H��%���H�H�[�'�
�8�8�K� � ��1������)�(��%�
$�s)�E�E)�	E:�E&�%E&�)
E7�:
F)�.git�.s..r)�elementc�0�UR5[;$r<)�lower�INVALID_DOTNAMES)rms r*�validate_path_element_defaultrqs���=�=�?�"2�2�2r)c�f�URS5R5nU[;agUS:Xagg)Ns. Fsgit~1T)�rstriprorp)rm�strippeds  r*�validate_path_element_ntfsrus3���~�~�e�$�*�*�,�H��#�#���8���r)c�V�URS5nUHnU"U5(aM g g)z2Default path validator that just checks for .git/.reFT)�split)rc�element_validator�partsrns    r*�
validate_pathrzs-���J�J�t��E�
�� ��#�#���r)�	root_path�
index_path�tree_idrYc���[USS9n[U[5(d[R"U5n[X#5GHn[
URU5(dM![XR5n	[RR[RRU	55(d3[R"[RRU	55 [UR5(aQ[RRU	5(d[R"U	5 [R "U	5n
O<X(R"n[U[$5(de['UURU	UUS9n
U(a[UR5(a�URU
R(U
R*U
R,U
R.U
R0U
R2U
R4U
R6U
R84
nU
R;U5n
[=X�R"5XxR'GM UR?5 g)ajGenerate and materialize index from a tree.

Args:
  tree_id: Tree to materialize
  root_path: Target dir for materialized index files
  index_path: Target path for generated index
  object_store: Non-empty object store holding tree contents
  honor_filemode: An optional flag to honor core.filemode setting in
    config file, default is core.filemode=True, change executable bit
  validate_path_element: Function to validate path elements to check
    out; default just refuses .git and .. directories.

Note: existing index is wiped and contents are not merged
    in a working dir. Suitable only for fresh clones.
F)ru)rYr[N) r�ryrCr��fsencoderrzrc�_tree_to_fs_pathr�rh�makedirsrr3�isdir�mkdirr_r7rrjr@r?�st_nlinkrArBrC�st_atimer>r=r�rEr|)
r{r|rr}rY�validate_path_elementr[r/r��	full_path�st�obj�st_tuples
             r*�build_index_from_treer�&s���0
�*�5�)�E��i��'�'��K�K�	�*�	�#�L�:���U�Z�Z�)>�?�?��$�Y�
�
�;�	��w�w�~�~�b�g�g�o�o�i�8�9�9��K�K������	�2�3��u�z�z�"�"��7�7�=�=��+�+�����#����)�$�B��y�y�)�C��c�4�(�(�(�(�%���
�
��-�%��B���U�Z�Z�!8�!8�
�
�
��	�	��	�	�����	�	��	�	��
�
�����������H����h�'�B�2�"�i�i�@��j�j��[;�^
�K�K�Mr)�fs_pathc���[U[5(de[5n[R"U5(ar[
RS:Xa@[R"[R"U55RU5UlU$[R"U5UlU$[US5nUR5UlSSS5 U$!,(df   U$=f)z�Create a blob from a path and a stat object.

Args:
  fs_path: Full file system path to file
  mode: File mode
Returns: A `Blob` object
rFr�N)ryrCrr�r�rcrdr��readlink�fsdecode�encode�datarfru)r�r3rZr\rvs     r*�blob_from_path_and_moder�ts����g�u�%�%�%�%��6�D��|�|�D����<�<�7�"����B�K�K��$8�9�@�@��O�D�I��K�	���G�,�D�I��K��'�4�
 �A�����D�I�!��K�!�
 ��K�s�;C�
C*c�.�[XRU5$)z�Create a blob from a path and a stat object.

Args:
  fs_path: Full file system path to file
  st: A stat object
Returns: A `Blob` object
)r�r<)r�r�rZs   r*�blob_from_path_and_statr��s��#�7�J�J�
�F�Fr)c���SSKJn SSKJn [	U[
5(d[R"U5nU"U5nUR5$!Ua gf=f![a gf=f)z�Read the head commit of a submodule.

Args:
  path: path to the submodule
Returns: HEAD sha, None if not a valid head/repository
r)�NotGitRepository)�RepoN)
�errorsr��repor�ryrr�r��headr6)rcr�r�r�s    r*�read_submodule_headr��sm��)���d�C� � ��{�{�4� ����D�z����y�y�{������������s#�A�A�A�A�
A+�*A+r.c���[RR[RRUS55(a[	U5nUR
U:waggg)a�Check if a directory has changed after getting an error.

When handling an error trying to create a blob from a path, call this
function. It will check if the path is a directory. If it's a directory
and a submodule, check the submodule head to see if it's has changed. If
not, consider the file as changed as Git tracked a file and not a
directory.

Return true if the given path should be considered as changed and False
otherwise or if the path is not a directory.
rkTF)r�rcr�rlr�r7)r.r�r�s   r*�_has_directory_changedr��sN��
�w�w�~�~�b�g�g�l�l�9�g�6�7�7�"�9�-���9�9������r)c#�# �[U[5(d[R"U5nUR	5GHup4[X5n[U[5(aUv� M,[R"U5n[R"UR5(a[X45(aUv� M~[R"UR5(d'[R"UR5(dM�[XV5nUbU"Xs5nURUR :waUv� GMGM g!["a	 Uv� GMf=f7f)z�Walk through an index and check for differences against working tree.

Args:
  index: index to check
  root_path: path in which to find files
Returns: iterator over paths with unstaged changes
N)ryrCr�rrr�rWr_r�r�r<r��S_ISREGr�r�r+r7r`)r/r{�filter_blob_callbackr.r�r�r�r\s        r*�get_unstaged_changesr��s����i��'�'��K�K�	�*�	�!�O�O�-��	�$�Y�:�	��e�1�2�2��O��	 ����)�$�B��|�|�B�J�J�'�'�)�)�;�;�#�O���<�<��
�
�+�+�D�L�L����4L�4L��*�9�9�D�#�/�+�D�<���w�w�%�)�)�#���$�5.��*!�	��O�	�sD�A(E�+AE�:E�<A
E�E�E�'E�E�E�E�E�asciic��[U[5(de[S:waURS[5nOUn[R
R
X5$)z�Convert a git tree path to a file system path.

Args:
  root_path: Root filesystem path
  tree_path: Git tree path as bytes

Returns: File system path.
re)ryrC�os_sep_bytes�replacer�rcrl)r{r.�sep_corrected_paths   r*r�r��sK���i��'�'�'�'��t��&�.�.�t�\�B��&��
�7�7�<�<�	�6�6r)c��[U[5(d[R"U5nOUn[S:waUR[S5nU$UnU$)zuConvert a file system path to a git tree path.

Args:
  fs_path: File system path.

Returns:  Git tree path as bytes
re)ryrCr�rr�r�)r��
fs_path_bytesr.s   r*�_fs_to_tree_pathr�sS���g�u�%�%����G�,�
��
��t��!�)�)�,��=�	���"�	��r)c���[RR[RRUS55(a[	U5nUcg[X[S9$g)Nrk)r3)r�rcr�rlr�rEr)r�rcr�s   r*�index_entry_from_directoryr�sF��	�w�w�~�~�b�g�g�l�l�4��1�2�2�"�4�(���<��$�R�K�@�@�r)c��[U[5(de[R"U5n[R
"UR5(a[X 5$[R"UR5(d%[R"UR5(a4[X5nUbURU5 [X#R5$g)aCCreate an index from a filesystem path.

This returns an index value for files, symlinks
and tree references. for directories and
non-existent files it returns None

Args:
  path: Path to create an index entry for
  object_store: Optional object store to
    save new blobs in
Returns: An index entry; None for directories
N)ryrCr�r_r�r�r<r�r�r�r�r*rEr+)rcrr�r\s    r*�index_entry_from_pathr�"s����d�E�"�"�"�"�	���$��B��|�|�B�J�J���)�"�3�3��|�|�B�J�J���4�<�<��
�
�#;�#;�&�t�0���#��#�#�D�)�$�R���1�1�r)rc#�# �UHn[X5n[XBS9nX54v� M g![[4a SnNf=f7f)z�Iterate over current versions of index entries on disk.

Args:
  paths: Paths to iterate over
  root_path: Root path to access from
  object_store: Optional store to save new blobs in
Returns: Iterator over path, index_entry
�rN)r�r�r`�IsADirectoryError)rr{rrcrnr�s      r*�iter_fresh_entriesr�?sO������Y�-��	�)�!�G�E��k��
��"�#4�5�	��E�	�s�?�	'�
?�<�?�<�?c#�# �[XUS9H=upEUcU(a	USS4v� MMXER[UR54v� M? g7f)aIterate over versions of objects on disk referenced by index.

Args:
  root_path: Root path to access from
  include_deleted: Include deleted entries with sha and
    mode set to None
  object_store: Optional object store to report new items to
Returns: Iterator over path, sha, mode
r�N)r�r7r�r3)rr{�include_deletedrrcr�s      r*�iter_fresh_objectsr�UsO���*�%��V����=���D�$�&�&���	�	�<��
�
�#;�;�;�W�r�c�F�[X5Hup#U(dMX0U'M g)z�Refresh the contents of an index.

This is the equivalent to running 'git commit -a'.

Args:
  index: Index to update
  root_path: Root filesystem path
N)r�)r/r{rcr�s    r*�
refresh_indexr�is!��*�%�;����5��$�K�<r)c�@�\rSrSrSrS\\\4SS4SjrSr	Sr
S	rg)
�locked_indexiwzHLock the index while making modifications.

Works as a context manager.
rcr:Nc��Xlgr<)�_path)r@rcs  r*r]�locked_index.__init__}s���
r)c��[URS5Ul[UR5UlUR$)Nr�)r
r��_filer��_indexr?s r*�	__enter__�locked_index.__enter__�s.���T�Z�Z��.��
��D�J�J�'����{�{�r)c��UbURR5 g[UR5n[X@RR
5 UR
5 g![a URR5 gf=fr<)r��abortrr�r�r�r��
BaseException)r@�exc_type�	exc_value�	tracebackrvs     r*�__exit__�locked_index.__exit__�sl�����J�J�����	��4�:�:�&�A��Q��� 3� 3�4�
�G�G�I���	��J�J����	�s�4A%�%$B�B)r�r�r�)r r!r"r#r_rrCrr]r�r�r(rr)r*r�r�ws-���
�U�5�#�:�.��4���

r)r�r�r<r)rX)FN)br_r�r�rsrc�collections.abcrr�dataclassesr�enumr�typingrrr	r
r�filer
rr�objectsrrrrrrrr}rrrr=r>r��
FLAG_VALIDr��EXTENDED_FLAG_SKIP_WORKTREE�EXTENDED_FLAG_INTEND_TO_ADDr�rr,rIrW�	ExceptionrarCrGrjrorwr�rEr�r�r�r�rr��listr�r�r�r�rr1rrErdrKrHrSrjrpr rqrurzrr�r�r�r�r�r��sepr�r�r�r�r�r�r�r�r�r�rr)r*�<module>r�s���,,�	��
�
�.�!�����,����:�9������
��
��
�%��%�����D���G�G��G�$�'
�'
��'
�T��$/�i�/�#�E�#�e�E�5�L�1�#�"-�
+�$�"+��+�)=�+�\!@� 4�!@�s�!@�t�!@�H,�Y�,�	+�(�	+�x�(<�=�	+��$�u�e�J�8L�,L�&M�M�N��4PT�-��-��3�4�-�?G��}�-�	�-�*"�2��2�
�%��z�+?�?�@�@�
A�2��c�]�2�
�	2�:�s��s��._=�_=�D)�!�)�*2�5���s�9J�3K�*L�)�
�)�X	:��	:�u�	:��	:�"�/H��E�?�/H��E�7�E�%��*�$5�5�6�/H�"�/H��5�/�	/H��	�
�h�u�o�x���.�/�
�h�s�m�X�c�]�*�+�
�h�u�o�x���.�/�	1���
/H�j��
���3�-��6�<�<�7�����X�t�X��j�j�G����.!�
�.!�

�.!��.!�b/��3�5�3�T�3����$��2O����SW�� �7��K��S�%�Z� �K��c�5�j�!�K�"�K��	K�
�K�
�K�\�U��#��,G�U�G��e�C��J�/��H�U�O��0�e��t��4FJ�) ��) �"�3��:�.�) �X�v�v�}�}�W�%��7��7�%�7�"�e�C��J�/��E��&���8�J�3G��<@��
��'��8��
�j���@/3���E�?�����?�+���e�E�8�J�/�/�0�1�	�.SW�<��E�?�<�',�<�
�e�E�8�E�?�H�S�M�9�:�;�<�( �� �5� �T� ��r)

Youez - 2016 - github.com/yon3zu
LinuXploit