§
    dŠtj“  ã                   óJ   — d dl Z d dlZd dlmZ ddlmZ  G d„ de¦  «        ZdS )é    N)ÚAbstractFileSystemé   )Ú
MemoryFilec                   ó¤   ‡ — e Zd ZdZdZdZdˆ fd„	Zeˆ fd„¦   «         Zd„ Z	e
d„ ¦   «         Ze
dd	„¦   «         Zdd
„Zdd„Zdd„Z	 	 	 	 	 dd„Zˆ xZS )ÚGitFileSystemz\Browse the files of a local git repo at any hash/tag/branch

    (experimental backend)
    Ú TNc                 ó¨   •—  t          ¦   «         j        di |¤Ž t          j        |p|pt	          j        ¦   «         ¦  «        | _        |pd| _        dS )aM  

        Parameters
        ----------
        path: str (optional)
            Local location of the repo (uses current directory if not given).
            May be deprecated in favour of ``fo``. When used with a higher
            level function such as fsspec.open(), may be of the form
            "git://[path-to-repo[:]][ref@]path/to/file" (but the actual
            file path should not contain "@" or ":").
        fo: str (optional)
            Same as ``path``, but passed as part of a chained URL. This one
            takes precedence if both are given.
        ref: str (optional)
            Reference to work with, could be a hash, tag or branch name. Defaults
            to current working tree. Note that ``ls`` and ``open`` also take hash,
            so this becomes the default for those operations
        kwargs
        ÚmasterN© )ÚsuperÚ__init__Úpygit2Ú
RepositoryÚosÚgetcwdÚrepoÚref)ÚselfÚpathÚfor   ÚkwargsÚ	__class__s        €úX/var/www/html/CA-Chatbot/venv/lib/python3.11/site-packages/fsspec/implementations/git.pyr   zGitFileSystem.__init__   sS   ø€ ð( 	�‰ŒÔÐ"Ð"˜6Ð"Ð"Ð"ÝÔ% bÐ&?¨DÐ&?µB´I±K´KÑ@Ô@ˆŒ	Ø�?˜(ˆŒˆˆó    c                 ó  •— t          ¦   «                              |¦  «                             d¦  «        }d|v r|                     dd¦  «        d         }d|v r|                     dd¦  «        d         }|                     d¦  «        S )Nú/ú:r   ú@)r   Ú_strip_protocolÚlstripÚsplit)Úclsr   r   s     €r   r   zGitFileSystem._strip_protocol+   s|   ø€ å‰wŒw×&Ò& tÑ,Ô,×3Ò3°CÑ8Ô8ˆØ�$ˆ;ˆ;Ø—:’:˜c 1Ñ%Ô% aÔ(ˆDØ�$ˆ;ˆ;Ø—:’:˜c 1Ñ%Ô% aÔ(ˆDØ�{Š{˜3ÑÔÐr   c                 óþ   — | j                              |p| j        ¦  «        \  }}|                     d¦  «        }|j        }|D ]9}|r5t          |t          j        ¦  «        r||vrt          |¦  «        ‚||         }Œ:|S )Nr   )	r   Úresolve_refishr   r!   ÚtreeÚ
isinstancer   ÚTreeÚFileNotFoundError)r   r   r   ÚcommÚpartsr%   Úparts          r   Ú_path_to_objectzGitFileSystem._path_to_object4   s‰   € Ø”I×,Ò,¨S¨_°D´HÑ=Ô=‰	ˆˆcØ—
’
˜3‘”ˆØŒyˆØð 	"ð 	"ˆDØð "�
 4­¬Ñ5Ô5ð "Ø˜tÐ#Ð#Ý+¨DÑ1Ô1Ð1Ø˜D”z�øØˆr   c                 ó´   — |                       d¦  «        } i }d| v r|                      dd¦  «        \  |d<   } d| v r|                      dd¦  «        \  |d<   } |S )Nzgit://r   r   r   r   r   )Úremoveprefixr!   )r   Úouts     r   Ú_get_kwargs_from_urlsz#GitFileSystem._get_kwargs_from_urls?   si   € à× Ò  Ñ*Ô*ˆØˆØ�$ˆ;ˆ;Ø $§
¢
¨3°Ñ 2Ô 2ÑˆC�‰K˜Ø�$ˆ;ˆ;Ø#Ÿzšz¨#¨qÑ1Ô1ÑˆC�‰J˜Øˆ
r   c                 ó  — t          | t          j        ¦  «        }|rdnd|r1d                     || j        pdg¦  «                             d¦  «        n| j        t          | j        ¦  «        | j        €dn| j        d›|rdn| j	        dœS )	NÚ	directoryÚfiler   r   Ú100644Úor   )ÚtypeÚnameÚhexÚmodeÚsize)
r&   r   r'   Újoinr7   r    ÚstrÚidÚfilemoder:   )Úobjr   Úis_dirs      r   Ú_object_to_infozGitFileSystem._object_to_infoI   s“   € õ ˜C¥¤Ñ-Ô-ˆà#)Ð5�K�K¨và@DÐR�—’˜$ ¤ ¨BÐ/Ñ0Ô0×7Ò7¸Ñ<Ô<Ð<È#Ì(å�s”v‘;”;Ø #¤Ð 4�H�H¸S¼\Ð:MÐ:MØÐ-�A�A S¤Xð
ð 
ð 	
r   c                 ó°   ‡‡— |                       |                      ‰¦  «        |¦  «        }ˆˆfd„t          |t          j        ¦  «        r|n|gD ¦   «         S )Nc                 óŒ   •— g | ]@}‰rt                                |‰¦  «        n t                                |‰¦  «        d          ‘ŒAS )r7   )r   rA   )Ú.0r?   Údetailr   s     €€r   ú
<listcomp>z$GitFileSystem.ls.<locals>.<listcomp>Y   s^   ø€ ð 
ð 
ð 
ð ð ðB�M×)Ò)¨#¨tÑ4Ô4Ð4å×.Ò.¨s°DÑ9Ô9¸&ÔAð
ð 
ð 
r   )r,   r   r&   r   r'   )r   r   rE   r   r   r%   s    ``   r   ÚlszGitFileSystem.lsW   sp   øø€ Ø×#Ò# D×$8Ò$8¸Ñ$>Ô$>ÀÑDÔDˆð
ð 
ð 
ð 
ð 
õ !+¨4µ´Ñ =Ô =ÐI˜˜ÀDÀ6ð	
ñ 
ô 
ð 	
r   c                 óŠ   — |                       |                      |¦  «        |¦  «        }t                               ||¦  «        S ©N)r,   r   r   rA   )r   r   r   r   r%   s        r   ÚinfozGitFileSystem.info`   s;   € Ø×#Ò# D×$8Ò$8¸Ñ$>Ô$>ÀÑDÔDˆÝ×,Ò,¨T°4Ñ8Ô8Ð8r   c                 ó<   — |                       ||¬¦  «        d         S )N)r   r8   )rJ   )r   r   r   s      r   ÚukeyzGitFileSystem.ukeyd   s   € Ø�yŠy˜ 3ˆyÑ'Ô'¨Ô.Ð.r   Úrbc                 óf   — |                       ||p| j        ¦  «        }t          |j        ¬¦  «        S )N)Údata)r,   r   r   rO   )	r   r   r9   Ú
block_sizeÚ
autocommitÚcache_optionsr   r   r?   s	            r   Ú_openzGitFileSystem._openg   s2   € ð ×"Ò" 4¨¨°´Ñ9Ô9ˆÝ˜sœxÐ(Ñ(Ô(Ð(r   )NNNrI   )TN)rM   NTNN)Ú__name__Ú
__module__Ú__qualname__Ú__doc__Úroot_markerÚcachabler   Úclassmethodr   r,   Ústaticmethodr0   rA   rG   rJ   rL   rS   Ú__classcell__)r   s   @r   r   r   
   s#  ø€ € € € € ðð ð
 €KØ€Hð#ð #ð #ð #ð #ð #ð0 ð ð  ð  ð  ñ „[ð ð	ð 	ð 	ð ðð ñ „\ðð ð
ð 
ð 
ñ „\ð
ð
ð 
ð 
ð 
ð9ð 9ð 9ð 9ð/ð /ð /ð /ð ØØØØð)ð )ð )ð )ð )ð )ð )ð )r   r   )r   r   Úfsspec.specr   Úmemoryr   r   r   r   r   ú<module>r_      sz   ðØ 	€	€	€	à €€€à *Ð *Ð *Ð *Ð *Ð *à Ð Ð Ð Ð Ð ðh)ð h)ð h)ð h)ð h)Ð&ñ h)ô h)ð h)ð h)ð h)r   