§
    ÎÑßjQ- ã                  óÚ  — U d dl mZ ddgZd dlZd dlZd dlZd dlZd dlZd dlZd dl	Z	d dl
Z
d dl
mZmZmZ d dlZd dlmZ d dlZd dlZd dlmZmZmZ d dlmZmZmZmZmZ d d	lmZmZm Z m!Z!m"Z"m#Z# d d
l$m%Z%m&Z&m'Z'm(Z(m)Z)m*Z*m+Z+m,Z,m-Z-m.Z.m/Z/m0Z0m1Z1m2Z2m3Z3m4Z4m5Z5 ej6        dk    rd dl$m7Z7 nd dl8m7Z7 d dl9m:Z:m;Z;m<Z< e0rd dl=m>Z> d dl?m@Z@ h d£ZA ejB        eC¦  «        ZD	 	 	 dNdOd „ZEd!eFd"<   ejG        d#k    rd$dd%œdPd.„ZHeHZIneZIdQd1„ZJdRdSd8„ZKdRdTd=„ZL G d>„ d?¦  «        ZMd@eM_C        dAeM_N         G dB„ dC¦  «        ZOdDeO_C        dEeO_N        dFZPdGZQdUdI„ZR G dJ„ dKeS¦  «        ZTeTZU	  G dL„ deT¬M¦  «        ZVdS )Vé    )ÚannotationsÚGitMetaÚGitN)ÚDEVNULLÚPIPEÚPopen)Údedent)ÚdefencÚforce_bytesÚsafe_decode)ÚCommandErrorÚGitCommandErrorÚGitCommandNotFoundÚUnsafeOptionErrorÚUnsafeProtocolError)ÚcygpathÚexpand_pathÚis_cygwin_gitÚ	patch_envÚremove_password_if_presentÚstream_copy)ÚAnyÚAnyStrÚBinaryIOÚCallableÚDictÚIOÚIteratorÚListÚMappingÚOptionalÚSequenceÚTYPE_CHECKINGÚTextIOÚTupleÚUnionÚcastÚoverload)é   é
   )Ú	TypeAlias)ÚLiteralÚPathLikeÚTBD)Ú	DiffIndex)ÚRepo>   ÚenvÚshellÚistreamÚ
as_processÚwith_stdoutÚoutput_streamÚmax_chunk_sizeÚwith_exceptionsÚstdout_as_stringÚkill_after_timeoutÚuniversal_newlinesÚwith_extended_outputÚstrip_newline_in_stdoutTÚprocessú'Git.AutoInterrupt' | PopenÚstdout_handlerúsUnion[None, Callable[[AnyStr], None], Callable[[List[AnyStr]], None], Callable[[bytes, 'Repo', 'DiffIndex'], None]]Ústderr_handlerúEUnion[None, Callable[[AnyStr], None], Callable[[List[AnyStr]], None]]Ú	finalizerú@Union[None, Callable[[Union[Popen, 'Git.AutoInterrupt']], None]]Údecode_streamsÚboolr:   úUnion[None, float]ÚreturnÚNonec           	     óV  — dd„}t          | d¦  «        rQt          d| ¦  «        } t          | j        dd¦  «        }| j        r| j        j        nd}| j        r| j        j        nd}	n4t          t          | ¦  «        } t          | dd¦  «        }| j        }| j        }	t          |t          t          f¦  «        s| 
                    ¦   «         }g }
|r|
                     d||f¦  «         |	r|
                     d|	|f¦  «         g }|
D ]Q\  }}}t          j        ||||||f¬¦  «        }d|_        |                     ¦   «          |                     |¦  «         ŒR|D ]Á}|                     |¬¦  «         |                     ¦   «         r•t          | t$          j        ¦  «        r|                      ¦   «          nt+          d|› d�¦  «        ‚|rQd|› d�}|s>t          |	t,          ¦  «        r)t          t.          |¦  «        }|                     ¦   «         } ||¦  «         ŒÂ|r || ¦  «         dS dS )aÿ  Register for notifications to learn that process output is ready to read, and
    dispatch lines to the respective line handlers.

    This function returns once the finalizer returns.

    :param process:
        :class:`subprocess.Popen` instance.

    :param stdout_handler:
        f(stdout_line_string), or ``None``.

    :param stderr_handler:
        f(stderr_line_string), or ``None``.

    :param finalizer:
        f(proc) - wait for proc to finish.

    :param decode_streams:
        Assume stdout/stderr streams are binary and decode them before pushing their
        contents to handlers.

        This defaults to ``True``. Set it to ``False`` if:

        - ``universal_newlines == True``, as then streams are in text mode, or
        - decoding must happen later, such as for :class:`~git.diff.Diff`\s.

    :param kill_after_timeout:
        :class:`float` or ``None``, Default = ``None``

        To specify a timeout in seconds for the git command, after which the process
        should be killed.
    Úcmdlineú	List[str]ÚnameÚstrÚstreamúUnion[BinaryIO, TextIO]Ú	is_decoderG   Úhandlerú0Union[None, Callable[[Union[bytes, str]], None]]rI   rJ   c           	     ó  — 	 |D ]N}|rJ|r=t          |t          ¦  «        sJ ‚|                     t          ¦  «        } ||¦  «         ŒC ||¦  «         ŒOn~# t          $ rq}t
                               d|›dt          | ¦  «        › d|›�¦  «         dt          |¦  «        vr&t          d|› d�gt          | ¦  «        z   |¦  «        |‚Y d }~nd }~ww xY w| 
                    ¦   «          d S # | 
                    ¦   «          w xY w)NzPumping z of cmd(z) failed due to: zI/O operation on closed fileú<z-pump>)Ú
isinstanceÚbytesÚdecoder
   Ú	ExceptionÚ_loggerÚerrorr   rO   r   Úclose)rL   rN   rP   rR   rS   ÚlineÚline_strÚexs           ú;/opt/saltstack/salt/lib/python3.11/site-packages/git/cmd.pyÚpump_streamz*handle_process_output.<locals>.pump_stream•   sG  € ð	Øð &ð &�Øð &Ø ð &Ý)¨$µÑ6Ô6Ð6Ð6Ð6Ø#'§;¢;­vÑ#6Ô#6˜Ø˜ Ñ)Ô)Ð)Ð)à˜ ™œ˜øð&øõ ð 	ið 	ið 	iÝ�MŠMÐq TÐqÐqÕ5OÐPWÑ5XÔ5XÐqÐqÐkmÐqÐqÑrÔrÐrØ-µS¸±W´WÐ<Ð<å"Ð$4¨Ð$4Ð$4Ð$4Ð#5Õ8RÐSZÑ8[Ô8[Ñ#[Ð]_Ñ`Ô`ÐfhÐhð =Ð<Ð<Ð<Ð<øøøøð	iøøøð �LŠL‰NŒNˆNˆNˆNøˆF�LŠL‰NŒNˆNˆNøøøs1   ‚AA ÁC( Á
CÁA'C
ÃC( Ã
CÃC( Ã(C>ÚprocúGit.AutoInterruptÚargsÚ NÚstdoutÚstderr)Útargetre   T)ÚtimeoutzKThread join() timed out in cmd.handle_process_output(). kill_after_timeout=z secondsz?error: process killed because it timed out. kill_after_timeout=)rL   rM   rN   rO   rP   rQ   rR   rG   rS   rT   rI   rJ   )Úhasattrr'   Úgetattrrc   rg   rh   r   rW   ÚtupleÚlistÚsplitÚappendÚ	threadingÚThreadÚdaemonÚstartÚjoinÚis_aliver   ÚAutoInterruptÚ
_terminateÚRuntimeErrorr   rO   Úencode)r>   r@   rB   rD   rF   r:   rb   rL   Úp_stdoutÚp_stderrÚpumpsÚthreadsrN   rP   rS   ÚtÚ	error_strs                    ra   Úhandle_process_outputr�   f   s›  € ð^ð ð ð õ2 ˆw˜ÑÔð 	"ÝÐ*¨GÑ4Ô4ˆÝ5<¸W¼\È6ÐSUÑ5VÔ5VˆØ*1¬,Ð@�7”<Ô&Ð&¸DˆØ*1¬,Ð@�7”<Ô&Ð&¸Dˆˆå•u˜gÑ&Ô&ˆÝ˜' 6¨2Ñ.Ô.ˆØ”>ˆØ”>ˆå�g¥¥t˜}Ñ-Ô-ð "Ø—-’-‘/”/ˆà>@€EØð ;Ø�Š�h ¨.Ð9Ñ:Ô:Ð:Øð ;Ø�Š�h ¨.Ð9Ñ:Ô:Ð:à&(€Gà!&ð ð Ñˆˆf�gÝÔ K°wÀÀfÈnÐ^eÐ6fÐgÑgÔgˆØˆŒØ	�Š‰	Œ	ˆ	Ø�Š�qÑÔÐÐð ð *ð *ˆØ	�ŠÐ)ˆÑ*Ô*Ð*Ø�:Š:‰<Œ<ð 	*Ý˜'¥3Ô#4Ñ5Ô5ð Ø×"Ò"Ñ$Ô$Ð$Ð$å"ðHØ+=ðHð Hð Hñô ð ð ð 
*àrÐVhÐrÐrÐrð ð &ð 3­*°X½xÑ*HÔ*Hð 3å $¥S¨)Ñ 4Ô 4�IØ )× 0Ò 0Ñ 2Ô 2�Ið �˜yÑ)Ô)Ð)øàð Øˆ	�'ÑÔÐÐÐðð ó    zCallable[..., Popen]Úsafer_popenÚwin32F)r2   r1   ÚcommandúUnion[str, Sequence[Any]]r2   r1   úOptional[Mapping[str, str]]Úkwargsr   r   c               óÞ   — t           j        t           j        z  }|r|€i nt          |¦  «        }d|d<   t	          dd¦  «        5  t          | f|||dœ|¤Žcddd¦  «         S # 1 swxY w Y   dS )aì  Call :class:`subprocess.Popen` on Windows but don't include a CWD in the
        search.

        This avoids an untrusted search path condition where a file like ``git.exe`` in
        a malicious repository would be run when GitPython operates on the repository.
        The process using GitPython may have an untrusted repository's working tree as
        its current working directory. Some operations may temporarily change to that
        directory before running a subprocess. In addition, while by default GitPython
        does not run external commands with a shell, it can be made to do so, in which
        case the CWD of the subprocess, which GitPython usually sets to a repository
        working tree, can itself be searched automatically by the shell. This wrapper
        covers all those cases.

        :note:
            This currently works by setting the
            :envvar:`NoDefaultCurrentDirectoryInExePath` environment variable during
            subprocess creation. It also takes care of passing Windows-specific process
            creation flags, but that is unrelated to path search.

        :note:
            The current implementation contains a race condition on :attr:`os.environ`.
            GitPython isn't thread-safe, but a program using it on one thread should
            ideally be able to mutate :attr:`os.environ` on another, without
            unpredictable results. See comments in:
            https://github.com/gitpython-developers/GitPython/pull/1650
        NÚ1Ú"NoDefaultCurrentDirectoryInExePath)r2   r1   Úcreationflags)Ú
subprocessÚCREATE_NO_WINDOWÚCREATE_NEW_PROCESS_GROUPÚdictr   r   )r…   r2   r1   rˆ   rŒ   s        ra   Ú_safer_popen_windowsr‘   é   sá   € õH #Ô3µjÔ6YÑYˆð ð 	<à˜�"�"­¨c©¬ˆCØ8;ˆCÐ4Ñ5õ Ð;¸SÑAÔAð 	ð 	ÝØðàØØ+ð	ð ð
 ðð ð	ð 	ð 	ð 	ñ 	ô 	ð 	ð 	ð 	ð 	ð 	ð 	øøøð 	ð 	ð 	ð 	ð 	ð 	s   ÁA"Á"A&Á)A&ÚstringrO   c                ó.   — |                       dd¦  «        S )NÚ_ú-)Úreplace)r’   s    ra   Údashifyr—   +  s   € Ø�>Š>˜#˜sÑ#Ô#Ð#r‚   © Úselfú'Git'ÚexcludeúSequence[str]úDict[str, Any]c                ó.   ‡ ‡— ˆˆ fd„‰ j         D ¦   «         S )Nc                ó:   •— i | ]}|‰v¯|t          ‰|¦  «        “ŒS r˜   )rl   )Ú.0Úsr›   r™   s     €€ra   ú
<dictcomp>z!slots_to_dict.<locals>.<dictcomp>0  s/   ø€ ÐLÐLÐL A¸1ÀGÐ;KÐ;KˆA�w�t˜QÑÔÐ;KÐ;KÐ;Kr‚   )Ú	__slots__)r™   r›   s   ``ra   Úslots_to_dictr¤   /  s#   øø€ ØLÐLÐLÐLÐL¨¬ÐLÑLÔLÐLr‚   ÚobjectÚdúMapping[str, Any]Úexcludedc                óˆ   — |                      ¦   «         D ]\  }}t          | ||¦  «         Œ|D ]}t          | |d ¦  «         Œd S ©N)ÚitemsÚsetattr)r™   r¦   r¨   ÚkÚvs        ra   Ú$dict_to_slots_and__excluded_are_noner¯   3  s`   € Ø—’‘	”	ð ð ‰ˆˆ1Ý��a˜ÑÔÐÐØð ð ˆÝ��a˜ÑÔÐÐðð r‚   c                  óP   — e Zd ZU dZdZdZded<   dd„Zdd„Zdd„Z	dd„Z
ddd„ZdS )Ú_AutoInterrupta   Process wrapper that terminates the wrapped process on finalization.

    This kills/interrupts the stored process instance once this instance goes out of
    scope. It is used to prevent processes piling up in case iterators stop reading.

    All attributes are wired through to the contained process object.

    The wait method is overridden to perform automatic status code checking and possibly
    raise.
    ©rc   re   Ústatusr   ÚintÚ_status_code_if_terminaterc   úUnion[None, subprocess.Popen]re   r   rI   rJ   c                ó0   — || _         || _        d | _        d S rª   r²   )r™   rc   re   s      ra   Ú__init__z_AutoInterrupt.__init__O  s   € ØˆŒ	ØˆŒ	Ø(,ˆŒˆˆr‚   c                óè  — | j         €dS | j         }d| _         |j        r|j                             ¦   «          |j        r|j                             ¦   «          |j        r|j                             ¦   «          	 |                     ¦   «         �"| j        p|                     ¦   «         | _        dS n2# t          $ r%}t           
                    d|¦  «         Y d}~nd}~ww xY wt          �t          t          dd¦  «        €dS 	 |                     ¦   «          |                     ¦   «         }| j        p|| _        dS # t          t          f$ r&}t           
                    d|¦  «         Y d}~dS d}~ww xY w)z!Terminate the underlying process.Nz(Ignored error after process had died: %rÚkillz+Ignored error while terminating process: %r)rc   Ústdinr]   rg   rh   Úpollrµ   r³   ÚOSErrorr[   ÚinfoÚosrl   Ú	terminateÚwaitÚAttributeError)r™   rc   r`   r³   s       ra   rx   z_AutoInterrupt._terminateT  s™  € àŒ9ÐØˆFàŒyˆØˆŒ	ØŒ:ð 	ØŒJ×ÒÑÔÐØŒ;ð 	 ØŒK×ÒÑÔÐØŒ;ð 	 ØŒK×ÒÑÔÐð	IØ�yŠy‰{Œ{Ð&Ø"Ô<ÐKÀÇ	Â	ÁÄ�”Ø�ð 'øõ ð 	Ið 	Ið 	IÝ�LŠLÐCÀRÑHÔHÐHÐHÐHÐHÐHÐHøøøøð	Iøøøõ ˆ:�¥ V¨TÑ2Ô2Ð:ØˆFð
	LØ�NŠNÑÔÐØ—Y’Y‘[”[ˆFàÔ8ÐB¸FˆDŒKˆKˆKøÝ�Ð(ð 	Lð 	Lð 	Lõ
 �LŠLÐFÈÑKÔKÐKÐKÐKÐKÐKÐKÐKøøøøð	Løøøs0   Á94B0 Â0
CÂ:CÃCÄ6D: Ä:E1ÅE,Å,E1c                ó.   — |                       ¦   «          d S rª   )rx   ©r™   s    ra   Ú__del__z_AutoInterrupt.__del__{  s   € Ø�ŠÑÔÐÐÐr‚   ÚattrrO   c                ó,   — t          | j        |¦  «        S rª   )rl   rc   )r™   rÆ   s     ra   Ú__getattr__z_AutoInterrupt.__getattr__~  s   € Ý�t”y $Ñ'Ô'Ð'r‚   r‚   rh   úUnion[None, str, bytes]c                óL  ‡— |€dŠt          |d¬¦  «        Š| j        �&| j                             ¦   «         }| j        j        }n	| j        }d}dˆfd	„}|d
k    rK ||¦  «        }t
                               d|›�¦  «         t          t          | j	        ¦  «        ||¦  «        ‚|S )a[  Wait for the process and return its status code.

        :param stderr:
            Previously read value of stderr, in case stderr is already closed.

        :warn:
            May deadlock if output or error pipes are used and not handled separately.

        :raise git.exc.GitCommandError:
            If the return status is not 0.
        Nr‚   zutf-8)ÚdataÚencodingrP   úUnion[IO[bytes], None]rI   rX   c                ó�   •— | r@	 ‰t          |                      ¦   «         ¦  «        z   S # t          t          f$ r ‰pdcY S w xY w‰pdS )Nr‚   )r   Úreadr½   Ú
ValueError)rP   Ústderr_bs    €ra   Ú$read_all_from_possibly_closed_streamzA_AutoInterrupt.wait.<locals>.read_all_from_possibly_closed_stream™  sg   ø€ Øð 'ð+Ø#¥k°&·+²+±-´-Ñ&@Ô&@Ñ@Ð@øÝ¥Ð,ð +ð +ð +Ø#˜? sÐ*Ð*Ð*ð+øøøð  � 3Ð&s   …#) ©AÁ Ar   zAutoInterrupt wait stderr: )rP   rÍ   rI   rX   )
r   rc   rÁ   rh   r³   r[   Údebugr   r   re   )r™   rh   r³   r|   rÒ   ÚerrstrrÑ   s         @ra   rÁ   z_AutoInterrupt.wait‚  sÇ   ø€ ð ˆ>ØˆHÝ F°WÐ=Ñ=Ô=ˆàŒ9Ð Ø”Y—^’^Ñ%Ô%ˆFØ”yÔ'ˆHˆHà”[ˆFØˆHð	'ð 	'ð 	'ð 	'ð 	'ð 	'ð �QŠ;ˆ;Ø9Ð9¸(ÑCÔCˆFÝ�MŠMˆM¸V¸VÐEÑFÔFÐFÝ!Õ"<¸T¼YÑ"GÔ"GÈÐQWÑXÔXÐXØˆr‚   N)rc   r¶   re   r   rI   rJ   ©rI   rJ   )rÆ   rO   rI   r   )r‚   )rh   rÉ   rI   r´   )Ú__name__Ú
__module__Ú__qualname__Ú__doc__r£   rµ   Ú__annotations__r¸   rx   rÅ   rÈ   rÁ   r˜   r‚   ra   r±   r±   =  s©   € € € € € € ð	ð 	ð +€Ið &'ÐÐ&Ð&Ð&Ñ&ð-ð -ð -ð -ð
$Lð $Lð $Lð $LðNð ð ð ð(ð (ð (ð (ð&ð &ð &ð &ð &ð &ð &r‚   r±   rw   rd   c                  óX   — e Zd ZdZdZdd	„Zddd„Zddd„Zddd„Zdd„Z	dd„Z
e
Zdd„ZdS )Ú_CatFileContentStreamai  Object representing a sized read-only stream returning the contents of
    an object.

    This behaves like a stream, but counts the data read and simulates an empty stream
    once our sized content region is empty.

    If not all data are read to the end of the object's lifetime, we read the rest to
    ensure the underlying stream continues to work.
    )Ú_streamÚ_nbrÚ_sizeÚsizer´   rP   ú	IO[bytes]rI   rJ   c                ój   — || _         || _        d| _        |dk    r|                     d¦  «         d S d S )Nr   é   )rÝ   rß   rÞ   rÏ   )r™   rà   rP   s      ra   r¸   z_CatFileContentStream.__init__¼  s<   € ØˆŒØˆŒ
ØˆŒ	ð �1Š9ˆ9Ø�KŠK˜‰NŒNˆNˆNˆNð ˆ9r‚   éÿÿÿÿrX   c                ó.  — | j         | j        z
  }|dk    rdS |dk    rt          ||¦  «        }n|}| j                             |¦  «        }| xj        t          |¦  «        z  c_        | j         | j        z
  dk    r| j                             d¦  «         |S )Nr   r‚   rä   rã   )rß   rÞ   ÚminrÝ   rÏ   Úlen©r™   rà   Ú
bytes_leftrË   s       ra   rÏ   z_CatFileContentStream.readÇ  s›   € Ø”Z $¤)Ñ+ˆ
Ø˜Š?ˆ?Ø�3Ø�"Š9ˆ9å�z 4Ñ(Ô(ˆDˆDð ˆDàŒ|× Ò  Ñ&Ô&ˆØˆ	Œ	•S˜‘Y”YÑˆ	Œ	ð Œ:˜œ	Ñ! QÒ&Ð&ØŒL×Ò˜aÑ Ô Ð àˆr‚   c                óB  — | j         | j        k    rdS | j        | j         z
  }|dk    rt          ||¦  «        }n|}| j                             |¦  «        }| xj         t          |¦  «        z  c_         | j        | j         z
  dk    r| j                             d¦  «         |S )Nr‚   rä   r   rã   )rÞ   rß   ræ   rÝ   Úreadlinerç   rÏ   rè   s       ra   rë   z_CatFileContentStream.readlineÜ  s¥   € ØŒ9˜œ
Ò"Ð"Ø�3ð ”Z $¤)Ñ+ˆ
Ø�"Š9ˆ9Ý�z 4Ñ(Ô(ˆDˆDàˆDð Œ|×$Ò$ TÑ*Ô*ˆØˆ	Œ	•S˜‘Y”YÑˆ	Œ	ð Œ:˜œ	Ñ! QÒ&Ð&ØŒL×Ò˜aÑ Ô Ð ð ˆr‚   úList[bytes]c                óÌ   — | j         | j        k    rg S g }d}	 |                      ¦   «         }|sn5|                     |¦  «         |dk    r|t	          |¦  «        z  }||k    rnŒL|S )Nr   Trä   )rÞ   rß   rë   rp   rç   )r™   rà   ÚoutÚnbrr^   s        ra   Ú	readlinesz_CatFileContentStream.readlinesò  s‚   € ØŒ9˜œ
Ò"Ð"ØˆIð ˆØˆð	Ø—=’=‘?”?ˆDØð ØØ�JŠJ�tÑÔÐØ�bŠyˆyØ•s˜4‘y”yÑ �Ø˜’:�:Øð	ð ˆ
r‚   ú'Git.CatFileContentStream'c                ó   — | S rª   r˜   rÄ   s    ra   Ú__iter__z_CatFileContentStream.__iter__  s   € Øˆr‚   c                ó@   — |                       ¦   «         }|st          ‚|S rª   )rë   ÚStopIteration)r™   r^   s     ra   Ú__next__z_CatFileContentStream.__next__
  s"   € Ø�}Š}‰ŒˆØð 	 ÝÐàˆr‚   c                óf   — | j         | j        z
  }|r| j                             |dz   ¦  «         d S d S )Nrã   )rß   rÞ   rÝ   rÏ   )r™   ré   s     ra   rÅ   z_CatFileContentStream.__del__  sD   € Ø”Z $¤)Ñ+ˆ
Øð 	.ð ŒL×Ò˜j¨1™nÑ-Ô-Ð-Ð-Ð-ð	.ð 	.r‚   N)rà   r´   rP   rá   rI   rJ   )rä   )rà   r´   rI   rX   )rà   r´   rI   rì   )rI   rñ   )rI   rX   rÕ   )rÖ   r×   rØ   rÙ   r£   r¸   rÏ   rë   rð   ró   rö   ÚnextrÅ   r˜   r‚   ra   rÜ   rÜ   ¯  sÇ   € € € € € ðð ð -€Iðð ð ð ðð ð ð ð ð*ð ð ð ð ð,ð ð ð ð ð*ð ð ð ðð ð ð ð €Dð.ð .ð .ð .ð .ð .r‚   rÜ   ÚCatFileContentStreamzGit.CatFileContentStreamzuGit.USE_SHELL is deprecated, because only its default value of False is safe. It will be removed in a future release.a  Setting Git.USE_SHELL to True is unsafe and insecure, as the effect of special shell syntax cannot usually be accounted for. This can result in a command injection vulnerability and arbitrary code execution. Git.USE_SHELL is deprecated and will be removed in a future release.Úextra_dangerc                óZ   — t          j        | rt          nt          t          d¬¦  «         d S )Nr)   )Ú
stacklevel)ÚwarningsÚwarnÚ_USE_SHELL_DANGER_MESSAGEÚ_USE_SHELL_DEFAULT_MESSAGEÚDeprecationWarning©rú   s    ra   Ú_warn_use_shellr  -  s:   € Ý„MØ%1ÐQÕ!Ð!Õ7QÝØðñ ô ð ð ð r‚   c                  óD   ‡ — e Zd ZdZd	ˆ fd„Zd
ˆ fd„ZeseZeZˆ xZ	S ˆ xZ	S )Ú_GitMetaztMetaclass for :class:`Git`.

    This helps issue :class:`DeprecationWarning` if :attr:`Git.USE_SHELL` is used.
    rN   rO   rI   r   c                ór   •— |dk    rt          d¬¦  «         t          ¦   «                              |¦  «        S ©NÚ	USE_SHELLFr  ©r  ÚsuperÚ__getattribute__)ÚclsrN   Ú	__class__s     €ra   Ú__getattributez_GitMeta.__getattribute;  ó7   ø€ Ø�;ÒÐÝ¨Ð/Ñ/Ô/Ð/Ý‰wŒw×'Ò'¨Ñ-Ô-Ð-r‚   Úvaluec                óx   •— |dk    rt          |¬¦  «         t          ¦   «                              ||¦  «         d S )Nr  r  )r  r
  Ú__setattr__)r  rN   r  r  s      €ra   Ú	__setattrz_GitMeta.__setattr@  s?   ø€ Ø�;ÒÐÝ¨Ð/Ñ/Ô/Ð/Ý‰Œ×Ò˜D %Ñ(Ô(Ð(Ð(Ð(r‚   ©rN   rO   rI   r   )rN   rO   r  r   rI   r   )
rÖ   r×   rØ   rÙ   Ú_GitMeta__getattributeÚ_GitMeta__setattrr#   r  r  Ú__classcell__©r  s   @ra   r  r  5  s„   ø€ € € € € ðð ð
.ð .ð .ð .ð .ð .ð
)ð )ð )ð )ð )ð )ð
 ð  ð
 *ÐØˆˆˆˆˆð ð  ð  ð  r‚   r  c                  ó
  ‡ — e Zd ZU dZdZdZ ej        d¦  «        ZddgZ	dgZ
d�d
„ZdŽd„ZdZ	 ej                             dd¦  «        Z	 dZded<   	 dZdZdZ	  e¦   «         Zed�d�d„¦   «         Zed‘d„¦   «         Zeed’d“d „¦   «         ¦   «         Zeed”d•d#„¦   «         ¦   «         Zed”d–d%„¦   «         Zed—d&„¦   «         Zed˜d(„¦   «         Ze	 d™dšd.„¦   «         Z ed›dœd4„¦   «         Z!e"Z#d5ed6<   e$Z%d5ed7<   d�d�ˆ fd9„Z&džˆ fd<„Z'džˆ fd=„Z(dŸd>„Z)dd?œd dB„Z*e+d¡dC„¦   «         Z,e+d¢dE„¦   «         Z-ed£dK„¦   «         Z.eddLœd¤dO„¦   «         Z.edddPœd¥dR„¦   «         Z.ed¦dT„¦   «         Z.ed§dV„¦   «         Z.ddd!ddd!dd!ddde/j0        d!fd¨ˆ fdg„Z.d©di„Z1dªdk„Z2e3j4        d«dm„¦   «         Z5d¬dp„Z6d­d®dq„Z7ed¯ds„¦   «         Z8d°du„Z9ed±dw„¦   «         Z:ed²dy„¦   «         Z:ed³dz„¦   «         Z:d³d{„Z:d´d~„Z;dµd�„Z<d¶d„„Z=d·d†„Z>d¸d‡„Z?d¹d‰„Z@dºd‹„ZAd»dŒ„ZBˆ xZCS )¼r   aò  The Git class manages communication with the Git binary.

    It provides a convenient interface to calling the Git binary, such as in::

     g = Git( git_dir )
     g.init()                   # calls 'git init' program
     rval = g.ls_files()        # calls 'git ls-files' program

    Debugging:

    * Set the :envvar:`GIT_PYTHON_TRACE` environment variable to print each invocation
      of the command to stdout.
    * Set its value to ``full`` to see details about the returned values.
    )Ú_working_dirÚcat_file_allÚcat_file_headerÚ_version_infoÚ_version_info_tokenÚ_git_optionsÚ_persistent_git_optionsÚ_environment)r  r  r  r  z(.+)::.+z--upload-packz--execz--pathspec-from-filerI   r�   c                ó.   — t          | | j        ¬¦  «        S )N)r›   )r¤   Ú
_excluded_rÄ   s    ra   Ú__getstate__zGit.__getstate__˜  s   € Ý˜T¨4¬?Ð;Ñ;Ô;Ð;r‚   r¦   rJ   c                ó4   — t          | || j        ¬¦  «         d S )N)r¨   )r¯   r#  )r™   r¦   s     ra   Ú__setstate__zGit.__setstate__›  s   € Ý,¨T°1¸t¼ÐOÑOÔOÐOÐOÐOr‚   ÚgitÚGIT_PYTHON_TRACEFrG   r  ÚGIT_PYTHON_GIT_EXECUTABLEÚGIT_PYTHON_REFRESHNÚpathúUnion[None, PathLike]c           	     ó´  — |�?t           j                             |¦  «        }t           j                             |¦  «        }n*t           j                             | j        | j        ¦  «        }| j        }| j	        }|| _        t          ¦   «         | _	        d}	  | ¦   «                              ¦   «          d}n# t          t          f$ r Y nw xY w|�sˆt          d¦  «        | j        z  }|| _        || _	        |�€Pt           j                             | j        d¦  «                             ¦   «         }g d¢}g d¢}	g d¢}
||v rnû||	v s||
v r�t          d	¦  «        || j        d
                     |¦  «        d
                     |	¦  «        d
                     |
¦  «        | j        |d         fz  }||	v rt$                               |¦  «         nrt)          |¦  «        ‚t          d¦  «        | j        d
                     |¦  «        d
                     |	¦  «        d
                     |
¦  «        fz  }t)          |¦  «        ‚| j        | _        nt          ||¦  «        ‚|S )a5	  Update information about the git executable :class:`Git` objects will use.

        Called by the :func:`git.refresh` function in the top level ``__init__``.

        :param path:
            Optional path to the git executable. If not absolute, it is resolved
            immediately, relative to the current directory. (See note below.)

        :note:
            The top-level :func:`git.refresh` should be preferred because it calls this
            method and may also update other state accordingly.

        :note:
            There are three different ways to specify the command that refreshing causes
            to be used for git:

            1. Pass no `path` argument and do not set the
               :envvar:`GIT_PYTHON_GIT_EXECUTABLE` environment variable. The command
               name ``git`` is used. It is looked up in a path search by the system, in
               each command run (roughly similar to how git is found when running
               ``git`` commands manually). This is usually the desired behavior.

            2. Pass no `path` argument but set the :envvar:`GIT_PYTHON_GIT_EXECUTABLE`
               environment variable. The command given as the value of that variable is
               used. This may be a simple command or an arbitrary path. It is looked up
               in each command run. Setting :envvar:`GIT_PYTHON_GIT_EXECUTABLE` to
               ``git`` has the same effect as not setting it.

            3. Pass a `path` argument. This path, if not absolute, is immediately
               resolved, relative to the current directory. This resolution occurs at
               the time of the refresh. When git commands are run, they are run using
               that previously resolved path. If a `path` argument is passed, the
               :envvar:`GIT_PYTHON_GIT_EXECUTABLE` environment variable is not
               consulted.

        :note:
            Refreshing always sets the :attr:`Git.GIT_PYTHON_GIT_EXECUTABLE` class
            attribute, which can be read on the :class:`Git` class or any of its
            instances to check what command is used to run git. This attribute should
            not be confused with the related :envvar:`GIT_PYTHON_GIT_EXECUTABLE`
            environment variable. The class attribute is set no matter how refreshing is
            performed.
        NFTa0                  Bad git executable.
                The git executable must be specified in one of the following ways:
                    - be included in your $PATH
                    - be set via $%s
                    - explicitly set via git.refresh(<full-path-to-git-executable>)
                Úraise)ÚquietÚqÚsilencer¡   ÚsilentÚnoneÚnÚ0)rþ   ÚwÚwarningÚlogÚlrŠ   )r\   ÚeÚ	exceptionr.  ÚrÚ2ae                          %s
                        All git commands will error until this is rectified.

                        This initial message can be silenced or aggravated in the future by setting the
                        $%s environment variable. Use one of the following values:
                            - %s: for no message or exception
                            - %s: for a warning message (logging level CRITICAL, displayed by default)
                            - %s: for a raised exception

                        Example:
                            export %s=%s
                        ú|r   a–                          %s environment variable has been set but it has been set with an invalid value.

                        Use only the following values:
                            - %s: for no message or exception
                            - %s: for a warning message (logging level CRITICAL, displayed by default)
                            - %s: for a raised exception
                        )r¿   r+  Ú
expanduserÚabspathÚenvironÚgetÚ_git_exec_env_varÚgit_exec_namer)  Ú_refresh_tokenr¥   Úversionr   ÚPermissionErrorr	   Ú_refresh_env_varÚlowerru   r[   ÚcriticalÚImportError)r  r+  Únew_gitÚold_gitÚold_refresh_tokenÚhas_gitÚerrÚmoder/  rþ   r\   s              ra   ÚrefreshzGit.refreshå  s}  € ð\ ÐÝ”g×(Ò(¨Ñ.Ô.ˆGÝ”g—o’o gÑ.Ô.ˆGˆGå”j—n’n SÔ%:¸CÔ<MÑNÔNˆGð Ô/ˆØÔ.ÐØ(/ˆÔ%Ý#™XœXˆÔð
 ˆð	ØˆC‰EŒE�MŠM‰OŒOˆOØˆGˆGøÝ"¥OÐ4ð 	ð 	ð 	ØˆDð	øøøð ñ ]	7åðñô ð Ô'ñ	(ð ð -4ˆCÔ)Ø!2ˆCÔà‰õ ”z—~’~ cÔ&:¸GÑDÔD×JÒJÑLÔL�àRÐRÐR�Ø@Ð@Ð@�ØFÐFÐF�à˜5�=�=ØØ˜T�\�\ T¨U ] ]Ý ðñô ð ØÔ,ØŸš ™œØŸš ™œØŸš ™œØÔ,Ø˜aœðñ�Cð0 ˜t�|�|Ý×(Ò(¨Ñ-Ô-Ð-Ð-å)¨#Ñ.Ô.Ð.å ðñ	ô 	ð Ô,ØŸš ™œØŸš ™œØŸš ™œð	ñ�Cõ & cÑ*Ô*Ð*ð 14Ô0A�Ô-Ð-õ )¨°#Ñ6Ô6Ð6àˆs   ÂB6 Â6C
Ã	C
c                ó*   — t          | j        ¦  «        S rª   )r   r)  )r  s    ra   Ú	is_cygwinzGit.is_cygwin‹  s   € å˜SÔ:Ñ;Ô;Ð;r‚   .ÚurlrO   rT  úLiteral[False]Úexpand_varsc                ó   — d S rª   r˜   ©r  rU  rT  rW  s       ra   Ú
polish_urlzGit.polish_url�  s   € àdgÐdgr‚   TúUnion[None, bool]c                ó   — d S rª   r˜   rY  s       ra   rZ  zGit.polish_url“  s   € àilÐilr‚   r-   c                óX  — |€|                       ¦   «         }|rt          ||¬¦  «        }n|rSt          j                             |¦  «        }|                     d¦  «        rt          j                             |¦  «        }|                     dd¦  «                             dd¦  «        }|S )aÇ  Remove any backslashes from URLs to be written in config files.

        Windows might create config files containing paths with backslashes, but git
        stops liking them as it will escape the backslashes. Hence we undo the escaping
        just to be sure.

        :param expand_vars:
            Expand environment variables and an initial ``~``. Disable this for values
            obtained from an untrusted source, such as remote URLs.
        N)rW  Ú~z\\ú\ú/)rT  r   r¿   r+  Ú
expandvarsÚ
startswithr?  r–   rY  s       ra   rZ  zGit.polish_url—  s¡   € ð ÐØŸš™œˆIàð 	?Ý˜#¨;Ð7Ñ7Ô7ˆCˆCàð 2Ý”g×(Ò(¨Ñ-Ô-�Ø—>’> #Ñ&Ô&ð 2Ýœ'×,Ò,¨SÑ1Ô1�CØ—+’+˜f dÑ+Ô+×3Ò3°D¸#Ñ>Ô>ˆCØˆ
r‚   c                óŽ   — | j                              |¦  «        }|r(|                     d¦  «        }t          d|› d�¦  «        ‚dS )a}  Check for unsafe protocols.

        Apart from the usual protocols (http, git, ssh), Git allows "remote helpers"
        that have the form ``<transport>::<address>``. One of these helpers (``ext::``)
        can be used to invoke any arbitrary command.

        See:

        - https://git-scm.com/docs/gitremote-helpers
        - https://git-scm.com/docs/git-remote-ext
        rã   zThe `zM::` protocol looks suspicious, use `allow_unsafe_protocols=True` to allow it.N)Úre_unsafe_protocolÚmatchÚgroupr   )r  rU  re  Úprotocols       ra   Úcheck_unsafe_protocolszGit.check_unsafe_protocols°  s[   € ð Ô&×,Ò,¨SÑ1Ô1ˆØð 	Ø—{’{ 1‘~”~ˆHÝ%Øo˜ÐoÐoÐoñô ð ð	ð 	r‚   Úoptionc                ó¾   — |                      d¦  «                             dd¦  «        d         }|                     dd¦  «        }|sdS t          |d         ¦  «        S )a  Return the option name used for unsafe-option checks.

        Examples:
            ``"--upload-pack=/tmp/helper"`` -> ``"upload-pack"``
            ``"upload_pack"`` -> ``"upload-pack"``
            ``"--config core.filemode=false"`` -> ``"config"``
        r•   ú=rã   r   Nrf   )Úlstripro   r—   )r  ri  Úoption_nameÚoption_tokenss       ra   Ú_canonicalize_option_namezGit._canonicalize_option_nameÄ  s_   € ð —m’m CÑ(Ô(×.Ò.¨s°AÑ6Ô6°qÔ9ˆØ#×)Ò)¨$°Ñ2Ô2ˆØð 	Ø�2Ý�} QÔ'Ñ(Ô(Ð(r‚   Ú46flnqsvÚoptionsrM   Úunsafe_optionsÚclusterable_short_optionsc                óR  ‡ — ˆ fd„|D ¦   «         }d„ |                      ¦   «         D ¦   «         }t          |¦  «        }t          d„ |D ¦   «         ¦  «        }|D �]M}‰                      |¦  «        }	|	sŒ|                     |	¦  «        }
|
�t          |
› d�¦  «        ‚|                     dd¦  «        d                              dd¦  «        d         }|                     d	¦  «        rQ|                     d
¦  «        s<|dd…         D ]1}|                     |¦  «        }
|
�t          |
› d�¦  «        ‚||vr nŒ2|                     d
¦  «        s|rt          |	¦  «        dk    s�Œ|                      ¦   «         D ],\  }}
|                     |	¦  «        rt          |
› d�¦  «        ‚Œ-�ŒOdS )an  Raise :class:`~git.exc.UnsafeOptionError` for blocked option spellings.

        In addition to exact matches, this rejects abbreviated long options accepted
        by Git (for example, ``--upl`` for ``--upload-pack``) and unsafe short options
        whose values are joined to the same token, including after clusterable flags
        (for example, ``-uVALUE`` and ``-fuVALUE``).

        A list containing only bare names is treated as normalized keyword arguments,
        so multi-character names such as ``upload_p`` are checked as long-option
        abbreviations. If any item starts with ``-``, the list is treated as tokenized
        command-line input: bare items can be option values and are not checked as
        abbreviations. Thus ``["--origin", "upload"]`` is allowed. Single-dash options
        use short-option parsing rather than broad prefix matching, preserving safe
        attached values such as ``-oupstream`` and ``-bcurrent``.

        Some options passed to ``git <command>`` can execute arbitrary commands and
        are therefore blocked by default unless the caller explicitly allows them.
        c                ó<   •— i | ]}‰                      |¦  «        |“ŒS r˜   )ro  )r    ri  r  s     €ra   r¢   z,Git.check_unsafe_options.<locals>.<dictcomp>ð  s*   ø€ Ð#oÐ#oÐ#oÐV\ C×$AÒ$AÀ&Ñ$IÔ$IÈ6Ð#oÐ#oÐ#or‚   c                ó”   — i | ]E\  }}|                      d ¦  «        r+|                      d¦  «        st          |¦  «        dk    ¯B||“ŒFS )r•   ú--rã   )rb  rç   )r    Ú	canonicalri  s      ra   r¢   z,Git.check_unsafe_options.<locals>.<dictcomp>ñ  sl   € ð  
ð  
ð  
á!�	˜6Ø× Ò  Ñ%Ô%ð 
ð /5×.?Ò.?ÀÑ.EÔ.Eð 
õ KNÈiÉ.Ì.Ð\]ÒJ]ÐJ]ð �vàJ]ÐJ]ÐJ]r‚   c              3  óB   K  — | ]}|                      d ¦  «         V — ŒdS )r•   N©rb  ©r    ri  s     ra   ú	<genexpr>z+Git.check_unsafe_options.<locals>.<genexpr>ú  s3   è è € Ð RÐ RÀ V×%6Ò%6°sÑ%;Ô%;Ð!;Ð RÐ RÐ RÐ RÐ RÐ Rr‚   Nz= is not allowed, use `allow_unsafe_options=True` to allow it.rk  rã   r   r•   rw  )	r«   Ú	frozensetÚallro  rB  r   ro   rb  rç   )r  rq  rr  rs  Úcanonical_unsafe_optionsÚunsafe_short_optionsÚclusterable_short_options_setÚoptions_are_kwargsri  Ú	candidateÚunsafe_optionÚoption_tokenÚoption_charrx  s   `             ra   Úcheck_unsafe_optionszGit.check_unsafe_optionsÓ  s1  ø€ ð: $pÐ#oÐ#oÐ#oÐ`nÐ#oÑ#oÔ#oÐ ð 
ð  
à%=×%CÒ%CÑ%EÔ%Eð 
ñ  
ô  
Ðõ )2Ð2KÑ(LÔ(LÐ%Ý Ð RÐ RÈ'Ð RÑ RÔ RÑRÔRÐØð 	ñ 	ˆFØ×5Ò5°fÑ=Ô=ˆIØð ØØ4×8Ò8¸ÑCÔCˆMØÐ(Ý'¨=Ð(wÐ(wÐ(wÑxÔxÐxØ!Ÿ<š<¨¨QÑ/Ô/°Ô2×8Ò8¸¸qÑAÔAÀ!ÔDˆLØ×&Ò& sÑ+Ô+ð °L×4KÒ4KÈDÑ4QÔ4Qð Ø#/°°°Ô#3ð ð �KØ$8×$<Ò$<¸[Ñ$IÔ$I�MØ$Ð0Ý/Ø,ÐkÐkÐkñô ð ð #Ð*GÐGÐGØ˜ð Hà×%Ò% dÑ+Ô+ð Ð0Bð ÅsÈ9Á~Ä~ÐXYÒGYÐGYÙØ,D×,JÒ,JÑ,LÔ,Lð ð Ñ(�	˜=Ø×'Ò'¨	Ñ2Ô2ð Ý+Ø(ÐgÐgÐgñô ð ðñð'	ð 	r‚   r˜   re   úSequence[Any]rˆ   úOptional[Mapping[str, Any]]c                óz  ‡— d„ |                       d„ |D ¦   «         ¦  «        D ¦   «         }|�r|                     dd¦  «        }|                     ¦   «         D ]â\  Š}t          |t          t
          f¦  «        r|n|f}t          d„ |D ¦   «         ¦  «        r£t          ‰¦  «        Št          ‰¦  «        dk    r&| 	                    dt          ‰¦  «        › �¦  «         Œ‡|r8| 	                    d‰› �¦  «         |                     d	„ |D ¦   «         ¦  «         ŒÁ|                     ˆfd
„|D ¦   «         ¦  «         Œã|S )zECollect possible option spellings before command-line transformation.c                ó<   — g | ]}|                      d ¦  «        ¯|‘ŒS )r•   rz  r{  s     ra   ú
<listcomp>z*Git._option_candidates.<locals>.<listcomp>  s=   € ð 
ð 
ð 
ØÐ_e×_pÒ_pÐqtÑ_uÔ_uð
Øð
ð 
ð 
r‚   c                ó   — g | ]}|®|‘ŒS rª   r˜   )r    Úargs     ra   rŒ  z*Git._option_candidates.<locals>.<listcomp>  s   € Ð2ZÐ2ZÐ2Z¸3È#È/°3È/È/È/r‚   Úsplit_single_char_optionsTc              3  ó.   K  — | ]}|d u p|duo|duV — ŒdS )TFNr˜   ©r    r  s     ra   r|  z)Git._option_candidates.<locals>.<genexpr>  s;   è è € ÐgÐgÐW\�u �}ÐR¨°eÐ);Ð)QÀÈTÐ@QÐgÐgÐgÐgÐgÐgr‚   rã   rw  r•   c              3  óˆ   K  — | ]=}|d u¯|dv¯
t          |¦  «                             d¦  «        ¯,t          |¦  «        V — Œ>dS )T©FNr•   N)rO   rb  r‘  s     ra   r|  z)Git._option_candidates.<locals>.<genexpr>$  sg   è è € ð 'ð 'à %Ø$¨DÐ0Ð0°UÀ-Ð5OÐ5OÕTWÐX]ÑT^ÔT^×TiÒTiÐjmÑTnÔTnÐ5Oõ   ™JœJà5OÐ5OÐ5OÐ5Oð'ð 'r‚   c              3  óL   •K  — | ]}|d u s|du¯
|®|d u rd‰› �nd‰› |› �V — ŒdS )TFNr•   r˜   )r    r  Úkeys     €ra   r|  z)Git._option_candidates.<locals>.<genexpr>*  sg   øè è € ð 'ð 'à %Ø$¨˜}˜}°¸eÐ1CÐ1CÈÐHYð */°$¨¨˜I ˜I˜I˜IÐ<LÀÐ<LÀUÐ<LÐ<LàHYÐHYÐHYÐHYð'ð 'r‚   )Ú_unpack_argsrB  r«   rW   rn   rm   ÚanyrO   rç   rp   r—   Úextend)r  re   rˆ   rq  r�  r  Úvaluesr•  s          @ra   Ú_option_candidateszGit._option_candidates  s’  ø€ ð
ð 
Ø!$×!1Ò!1Ð2ZÐ2ZÀ$Ð2ZÑ2ZÔ2ZÑ![Ô![ð
ñ 
ô 
ˆð ñ 	Ø(.¯
ª
Ð3NÐPTÑ(UÔ(UÐ%Ø$Ÿlšl™nœnð ð ‘
��UÝ",¨UµT½5°MÑ"BÔ"BÐP˜˜ÈÈ�ÝÐgÐgÐ`fÐgÑgÔgÑgÔgð Ý˜c™(œ(�CÝ˜3‘x”x 1’}�}ØŸšÐ':­G°C©L¬LÐ':Ð':Ñ;Ô;Ð;Ð;Ø2ð ØŸš y¨3 y yÑ1Ô1Ð1ØŸšð 'ð 'à)/ð'ñ 'ô 'ñ ô ð ð ð  Ÿšð 'ð 'ð 'ð 'à)/ð'ñ 'ô 'ñ ô ð øð
 ˆr‚   r+   rw   rù   Úworking_dirc                óÒ   •— t          ¦   «                              ¦   «          t          |¦  «        | _        d| _        g | _        i | _        d| _        d| _        d| _	        d| _
        dS )aa  Initialize this instance with:

        :param working_dir:
            Git directory we should work in. If ``None``, we always work in the current
            directory as returned by :func:`os.getcwd`.
            This is meant to be the working tree directory if available, or the
            ``.git`` directory in case of bare repositories.
        r˜   N)r
  r¸   r   r  r  r   r!  r  r  r  r  )r™   r›  r  s     €ra   r¸   zGit.__init__5  sp   ø€ õ 	‰Œ×ÒÑÔÐÝ'¨Ñ4Ô4ˆÔØ?AˆÔØ24ˆÔ$ð -/ˆÔð <@ˆÔØ+/ˆÔ ð 26ˆÔØ.2ˆÔÐÐr‚   rN   r   c                ór   •— |dk    rt          d¬¦  «         t          ¦   «                              |¦  «        S r  r	  ©r™   rN   r  s     €ra   r  zGit.__getattribute__N  r  r‚   c                ó€   •‡ ‡— ‰                      d¦  «        r!t          ¦   «                              ‰¦  «        S ˆˆ fd„S )zÒA convenience method as it allows to call the command as if it was an object.

        :return:
            Callable object that will execute call :meth:`_call_process` with your
            arguments.
        r”   c                 ó&   •—  ‰j         ‰g| ¢R i |¤ŽS rª   )Ú_call_process)re   rˆ   rN   r™   s     €€ra   ú<lambda>z!Git.__getattr__.<locals>.<lambda>\  s%   ø€ Ð'9 tÔ'9¸$Ð'PÀÐ'PÐ'PÐ'PÈÐ'PÐ'P€ r‚   )rb  r
  r  rž  s   ``€ra   rÈ   zGit.__getattr__S  sE   øøø€ ð �?Š?˜3ÑÔð 	2Ý‘7”7×+Ò+¨DÑ1Ô1Ð1ØPÐPÐPÐPÐPÐPr‚   c                ó.   —  | j         dddi|¤Ž| _        dS )a7  Specify command line options to the git executable for subsequent
        subcommand calls.

        :param kwargs:
            A dict of keyword arguments.
            These arguments are passed as in :meth:`_call_process`, but will be passed
            to the git command rather than the subcommand.
        r�  TNr˜   )Útransform_kwargsr   ©r™   rˆ   s     ra   Úset_persistent_git_optionszGit.set_persistent_git_options^  s,   € ð (= tÔ'<Ð'fÐ'fÐW[Ð'fÐ_eÐ'fÐ'fˆÔ$Ð$Ð$r‚   )Úallow_unsafe_optionsr§  úJUnion[str, bytes, Tuple[int, Union[str, bytes], str], 'Git.AutoInterrupt']c               ó–   — |s7|                       ||¦  «        }t                               || j        ¬¦  «          | j        dg|¢R i |¤ŽS )zžList references in a remote repository.

        :param allow_unsafe_options:
            Allow unsafe options, like ``--upload-pack`` or ``--exec``.
        )rq  rr  Ú	ls_remote)rš  r   r‡  Úunsafe_git_ls_remote_optionsr¡  )r™   r§  re   rˆ   Úcandidate_optionss        ra   rª  zGit.ls_remotej  sc   € ð $ð 	rØ $× 7Ò 7¸¸fÑ EÔ EÐÝ×$Ò$Ð->ÈtÔOpÐ$ÑqÔqÐqØ!ˆtÔ! +Ð?°Ð?Ð?Ð?¸Ð?Ð?Ð?r‚   c                ó   — | j         S )z(:return: Git directory we are working on)r  rÄ   s    ra   r›  zGit.working_dirz  s   € ð Ô Ð r‚   úTuple[int, ...]c                ó”  — | j         }| j        |u r| j        €
J d¦   «         ‚| j        S |                      d¦  «        }|                     d¦  «        d         }|                     d¦  «        dd…         }t          j        t          j        |¦  «        }t          t          t          |¦  «        ¦  «        | _        || _        | j        S )a  
        :return: Tuple with integers representing the major, minor and additional
            version numbers as parsed from :manpage:`git-version(1)`. Up to four fields
            are used.

            This value is generated on demand and is cached.
        Nz Bug: corrupted token-check staterF  ú é   ú.é   )rE  r  r  r¡  ro   Ú	itertoolsÚ	takewhilerO   Úisdigitrm   Úmapr´   )r™   Úrefresh_tokenÚprocess_versionÚversion_stringÚversion_fieldsÚleading_numeric_fieldss         ra   Úversion_infozGit.version_info  sÉ   € ð Ô+ˆð Ô# }Ð4Ð4ØÔ%Ð1Ð1Ð3UÑ1Ô1Ð1ØÔ%Ð%ð ×,Ò,¨YÑ7Ô7ˆØ(×.Ò.¨sÑ3Ô3°AÔ6ˆØ'×-Ò-¨cÑ2Ô2°2°A°2Ô6ˆÝ!*Ô!4µS´[À.Ñ!QÔ!QÐÝ"¥3¥sÐ,BÑ#CÔ#CÑDÔDˆÔð $1ˆÔ ØÔ!Ð!r‚   r…   r†   r4   úLiteral[True]ú'AutoInterrupt'c               ó   — d S rª   r˜   )r™   r…   r4   s      ra   ÚexecutezGit.execute›  s	   € ð ˜#r‚   )r4   r9   ú Union[str, Tuple[int, str, str]]c               ó   — d S rª   r˜   ©r™   r…   r4   r9   s       ra   rÁ  zGit.execute£  s	   € ð ,/¨3r‚   )r4   r9   ú$Union[bytes, Tuple[int, bytes, str]]c               ó   — d S rª   r˜   rÄ  s       ra   rÁ  zGit.execute¬  s	   € ð 03¨sr‚   r<   c               ó   — d S rª   r˜   ©r™   r…   r<   r4   r9   s        ra   rÁ  zGit.executeµ  s	   € ð ˆcr‚   rX   c               ó   — d S rª   r˜   rÈ  s        ra   rÁ  zGit.execute¿  s	   € ð �r‚   r3   úUnion[None, BinaryIO]r8   r6   r:   rH   r5   r;   r2   r1   úUnion[None, Mapping[str, str]]r7   r´   r=   Úsubprocess_kwargsúDUnion[str, bytes, Tuple[int, Union[str, bytes], str], AutoInterrupt]c                óŠ  •‡‡
‡‡‡ ‡!‡"‡#— t          |¦  «        Š!| j        r:| j        dk    s|r-t                               d                     ‰!¦  «        ¦  «         	 | j        pt          j        ¦   «         }t          j        t          |¦  «        t          j
        ¦  «        sd}n# t          $ r d}Y nw xY w|}t          j                             ¦   «         }d|d<   d|d<   |                     | j        ¦  «         |�|                     |¦  «         t           j        dk    r|�t%          ‰!d¦  «        ‚t&          }nt          }|	rt(          n/t+          t,          d	d¦  «        pt/          t          j        d
¦  «        }|€!t3          ¦   «                              d¦  «        }t                               d‰!||rdnd|‰
¦  «         	 t9          |f||d|pt:          t(          ||‰
‰
rt<          nddœ	|¤ŽŠ t?          t@          ‰ j!        ¦  «        ‰ _!        t?          t@          ‰ j"        ¦  «        ‰ _"        n# |$ r}tG          ‰!|¦  «        |‚d}~ww xY w|r|  $                    ‰ |¦  «        S dŠ#dŠd}t           j        dk    rN|�L|Š"d%ˆfd„}d&ˆ!ˆ"ˆ
fd„Šd'ˆˆˆ ˆ#fd„}tK          j&        ¦   «         ŠtK          j'        ‰"|‰ j(        f¬¦  «        Š#‰}n‰ j)        }d}d}d}‰
rdnd}	 ‰€Z |¦   «         \  }}|�!| *                    |¦  «        r|r
|dd…         }|�| *                    |¦  «        r
|dd…         }‰ j+        }�n|r|dk    r|ntX          j-        }‰#�‰# .                    ¦   «          	 ‰ j!        �/t_          ‰ j!        ‰|¦  «         ‰ j!         0                    ¦   «         }‰ j"        �‰ j"         0                    ¦   «         }‰  1                    ¦   «         }‰#�‰# 2                    ¦   «          n# ‰#�‰# 2                    ¦   «          w w xY w|�| *                    |¦  «        r
|dd…         }‰�"‰ 3                    ¦   «         r|€J ‚ |¦   «         }‰ j!        �‰ j!         4                    ¦   «          ‰ j"        �‰ j"         4                    ¦   «          nF# ‰ j!        �‰ j!         4                    ¦   «          ‰ j"        �‰ j"         4                    ¦   «          w w xY w| j        dk    r—d                     ‰!¦  «        }d(ˆfd!„}|r5t                               d"|| ||¦  «        tk          |¦  «        ¦  «         nE|r't                               d#|| ||¦  «        ¦  «         nt                               d$||¦  «         |r|dk    rt%          ‰!|||¦  «        ‚tm          |tn          ¦  «        r|rtk          |¦  «        }|r||tk          |¦  «        fS |S ))a1  Handle executing the command, and consume and return the returned
        information (stdout).

        :param command:
            The command to execute. A sequence of program arguments is recommended.
            A string is also accepted, but its meaning is strongly platform-dependent.

            By default, a shell is not used. On Unix-like systems, a string is the whole
            program name (so ``"git log -n 1"`` raises :class:`GitCommandNotFound`). On
            Windows, the program parses the arguments itself, so multi-word strings can
            work but are not portable.

            Avoid ``shell=True`` (and :attr:`Git.USE_SHELL`): this runs the command in
            a shell, which is generally unsafe. The shell interprets metacharacters
            such as ``;``, ``|``, ``&``, ``$(...)``, ``$VAR``, ``%VAR%``, and ``^``
            (depending on the platform) as syntax. Any untrusted text in the command
            can then execute arbitrary OS commands. See :attr:`Git.USE_SHELL`.

            Producing a sequence automatically by :func:`shlex.split` and passing it
            as the command is far safer than ``shell=True``. But :func:`shlex.split`
            parses POSIX shell syntax on all systems, and the result is still unsafe
            for anything but *fixed, fully trusted* strings. Do not use it on strings
            built by interpolating values: whitespace or quoting in an untrusted value
            can still inject arguments. For input derived in any way from untrusted
            data, build the argument sequence yourself, while ensuring each argument
            is fully sanitized.

        :param istream:
            Standard input filehandle passed to :class:`subprocess.Popen`.

        :param with_extended_output:
            Whether to return a (status, stdout, stderr) tuple.

        :param with_exceptions:
            Whether to raise an exception when git returns a non-zero status.

        :param as_process:
            Whether to return the created process instance directly from which
            streams can be read on demand. This will render `with_extended_output`
            and `with_exceptions` ineffective - the caller will have to deal with
            the details. It is important to note that the process will be placed
            into an :class:`AutoInterrupt` wrapper that will interrupt the process
            once it goes out of scope. If you use the command in iterators, you
            should pass the whole process instance instead of a single stream.

        :param output_stream:
            If set to a file-like object, data produced by the git command will be
            copied to the given stream instead of being returned as a string.
            This feature only has any effect if `as_process` is ``False``.

        :param stdout_as_string:
            If ``False``, the command's standard output will be bytes. Otherwise, it
            will be decoded into a string using the default encoding (usually UTF-8).
            The latter can fail, if the output contains binary data.

        :param kill_after_timeout:
            Specifies a timeout in seconds for the git command, after which the process
            should be killed. This will have no effect if `as_process` is set to
            ``True``. It is set to ``None`` by default and will let the process run
            until the timeout is explicitly specified. Uses of this feature should be
            carefully considered, due to the following limitations:

            1. This feature is not supported at all on Windows.
            2. Effectiveness may vary by operating system. ``ps --ppid`` is used to
               enumerate child processes, which is available on most GNU/Linux systems
               but not most others.
            3. Deeper descendants do not receive signals, though they may sometimes
               terminate as a consequence of their parent processes being killed.
            4. `kill_after_timeout` uses ``SIGKILL``, which can have negative side
               effects on a repository. For example, stale locks in case of
               :manpage:`git-gc(1)` could render the repository incapable of accepting
               changes until the lock is manually removed.

        :param with_stdout:
            If ``True``, default ``True``, we open stdout on the created process.

        :param universal_newlines:
            If ``True``, pipes will be opened as text, and lines are split at all known
            line endings.

        :param shell:
            Whether to invoke commands through a shell
            (see :class:`Popen(..., shell=True) <subprocess.Popen>`).
            If this is not ``None``, it overrides :attr:`USE_SHELL`.

            Passing ``shell=True`` to this or any other GitPython function should be
            avoided, as it is unsafe under most circumstances. This is because it is
            typically not feasible to fully consider and account for the effect of shell
            expansions, especially when passing ``shell=True`` to other methods that
            forward it to :meth:`Git.execute`. Passing ``shell=True`` is also no longer
            needed (nor useful) to work around any known operating system specific
            issues.

            On Unix-like systems, when migrating away from passing string commands with
            ``shell=True``, :func:`shlex.split` may serve as a transitional step in rare
            cases, with extreme care. (Drop ``shell=True`` and pass the resulting
            sequence as the command.) See the `command` parameter above on the risks.

        :param env:
            A dictionary of environment variables to be passed to
            :class:`subprocess.Popen`.

        :param max_chunk_size:
            Maximum number of bytes in one chunk of data passed to the `output_stream`
            in one invocation of its ``write()`` method. If the given number is not
            positive then the default value is used.

        :param strip_newline_in_stdout:
            Whether to strip the trailing ``\n`` of the command stdout.

        :param subprocess_kwargs:
            Keyword arguments to be passed to :class:`subprocess.Popen`. Please note
            that some of the valid kwargs are already set by this method; the ones you
            specify may not be the same ones.

        :return:
            * str(output), if `extended_output` is ``False`` (Default)
            * tuple(int(status), str(stdout), str(stderr)),
              if `extended_output` is ``True``

            If `output_stream` is ``True``, the stdout value will be your output stream:

            * output_stream, if `extended_output` is ``False``
            * tuple(int(status), output_stream, str(stderr)),
              if `extended_output` is ``True``

            Note that git is executed with ``LC_MESSAGES="C"`` to ensure consistent
            output regardless of system language.

        :raise git.exc.GitCommandError:

        :note:
            If you add additional keyword arguments to the signature of this method, you
            must update the ``execute_kwargs`` variable housed in this module.
        Úfullr°  NÚCÚLANGUAGEÚLC_ALLr„   z9"kill_after_timeout" feature is not supported on Windows.r   Úwbr  z<Popen(%s, cwd=%s, stdin=%s, shell=%s, universal_newlines=%s)z<valid stream>rJ   rä   )	r1   ÚcwdÚbufsizer»   rh   rg   r2   r;   rÌ   Úpidr´   rI   c                ó`  •— t          ddt          | ¦  «        gt          ¬¦  «        }g }|j        �|j        D ]w}t	          |                     ¦   «         ¦  «        dk    rP|                     ¦   «         d         }|                     ¦   «         r"|                     t          |¦  «        ¦  «         Œx	 t          j
        | t          j        ¦  «         |D ]2}	 t          j
        |t          j        ¦  «         Œ## t          $ r Y Œ/w xY w‰€J ‚‰                     ¦   «          n# t          $ r Y nw xY wdS )z†Callback to kill a process.

                This callback implementation would be ineffective and unsafe on Windows.
                Úpsz--ppid)rg   Nr   )r   rO   r   rg   rç   ro   r¶  rp   r´   r¿   rº   ÚsignalÚSIGKILLr½   Úset)rÖ  ÚpÚ
child_pidsr^   Ú	local_pidÚ	child_pidÚ
kill_checks         €ra   Úkill_processz!Git.execute.<locals>.kill_process·  sO  ø€ õ
 ˜4 ­3¨s©8¬8Ð4½TÐBÑBÔB�Ø�
Ø”8Ð'Ø !¤ð Bð B˜Ý˜tŸzšz™|œ|Ñ,Ô,¨qÒ0Ð0Ø)-¯ª©¬°qÔ(9˜IØ(×0Ò0Ñ2Ô2ð BØ *× 1Ò 1µ#°i±.´.Ñ AÔ AÐ AøðÝ”G˜C¥¤Ñ0Ô0Ð0Ø%/ð !ð !˜	ð!ÝœG I­v¬~Ñ>Ô>Ð>Ð>øÝ&ð !ð !ð !Ø ˜Dð!øøøð &Ð1Ð1Ð1Ø—N’NÑ$Ô$Ð$Ð$øÝð ð ð ð �Dðøøøð �s6   Â1#D ÃC5Ã4D Ã5
DÃ?D ÄDÄD Ä
D+Ä*D+úUnion[str, bytes]c                 óz   •— dd                      ‰¦  «        › d‰d›d�} ‰r| n|                      t          ¦  «        S )NzTimeout: the command "r°  z" did not complete in Úgz secs.)ru   rz   r
   )rP  Úredacted_commandrj   r;   s    €€€ra   Úmake_timeout_errorz'Git.execute.<locals>.make_timeout_errorÔ  sG   ø€ Ør¨s¯xªxÐ8HÑ/IÔ/IÐrÐrÐahÐrÐrÐrÐr�Ø0ÐH�s�s°c·j²jÅÑ6HÔ6HÐHr‚   úTuple[AnyStr, AnyStr]c                 óÖ   •— ‰€J ‚‰€J ‚‰                      ¦   «          ‰                     ¦   «         \  } }‰                     ¦   «          ‰                     ¦   «         r
 ‰¦   «         }| |fS rª   )rt   ÚcommunicateÚcancelÚis_set)rî   rP  rà  ræ  rc   Úwatchdogs     €€€€ra   ré  z Git.execute.<locals>.communicateØ  s{   ø€ ØÐ+Ð+Ð+Ø!Ð-Ð-Ð-Ø—’Ñ Ô Ð Ø×+Ò+Ñ-Ô-‘��SØ—’Ñ!Ô!Ð!Ø×$Ò$Ñ&Ô&ð /Ø,Ð,Ñ.Ô.�CØ˜C�x�r‚   )re   r   r‚   ú
ó   
Ústdout_valueúUnion[bytes, str]rO   c                ó,   •— ‰ rt          | ¦  «        pdS )Nz<OUTPUT_STREAM>)r   )rï  r6   s    €ra   Úas_textzGit.execute.<locals>.as_text  s   ø€ Ø(Ð(ÐF­[¸Ñ-FÔ-FÐ[ÐJ[Ð[r‚   z$%s -> %d; stdout: '%s'; stderr: '%s'z%s -> %d; stdout: '%s'z%s -> %d)rÖ  r´   rI   rJ   )rI   râ  )rI   rç  )rï  rð  rI   rO   )8r   r(  r[   r¾   ru   r  r¿   ÚgetcwdÚaccessrO   ÚX_OKÚFileNotFoundErrorrA  ÚcopyÚupdater!  ÚsysÚplatformr   r½   r   rl   r�   ÚopenÚdevnullr
  r  rÓ   rƒ   r   r
   r'   r   rg   rh   r   rw   rq   ÚEventÚTimerrÖ  ré  ÚendswithÚ
returncodeÚioÚDEFAULT_BUFFER_SIZErt   r   rÏ   rÁ   rê  rë  r]   r   rW   rX   )%r™   r…   r3   r<   r8   r4   r6   r9   r:   r5   r;   r2   r1   r7   r=   rÌ  rÔ  Ú
inline_envÚcmd_not_found_exceptionÚstdout_sinkrP  Útimeout_errorrá  ré  r³   rï  Ústderr_valueÚnewlineÚcmdstrrò  rà  ræ  rc   rå  rj   rì  r  s%         `   `                   @@@@@@€ra   rÁ  zGit.executeÉ  sü  øøøøøøøøø€ õt 6°gÑ>Ô>ÐØÔ ð 	5 dÔ&;¸vÒ&EÐ&EÈÐ&EÝ�LŠL˜ŸšÐ"2Ñ3Ô3Ñ4Ô4Ð4ð	ØÔ#Ð2¥r¤y¡{¤{ˆCÝ”9�S ™XœX¥r¤wÑ/Ô/ð Ø�øøÝ ð 	ð 	ð 	ØˆCˆCˆCð	øøøð ˆ
ÝŒj�oŠoÑÔˆð
 ˆˆJ‰ØˆˆH‰Ø�
Š
�4Ô$Ñ%Ô%Ð%ØÐ!Ø�JŠJ�zÑ"Ô"Ð"åŒ<˜7Ò"Ð"Ø!Ð-Ý%Ø$ØOñô ð õ '.Ð#Ð#å&7Ð#ð *Ðm•d�d­wµzÀ9ÈdÑ/SÔ/SÐ/mÕW[Õ\^Ô\fÐhlÑWmÔWmˆØˆ=õ ‘G”G×,Ò,¨[Ñ9Ô9ˆEÝ�ŠØJØØØ 'Ð3ÐÐ¨VØØñ	
ô 	
ð 	
ð	6ÝØðàØØØÐ)¥'ÝØ"ØØ#5Ø#5Ð?�˜¸4ðð ð $ðð ˆDõ" �x¨¬Ñ5Ô5ˆDŒKÝ�x¨¬Ñ5Ô5ˆDŒKˆKøð 'ð 	Eð 	Eð 	EÝ$Ð%5°sÑ;Ô;ÀÐDøøøøð	Eøøøð ð 	5Ø×%Ò% d¨GÑ4Ô4Ð4à.2ˆØ04ˆ
ØCGˆåŒ<˜7Ò"Ð"Ð'9Ð'Eà(ˆGðð ð ð ð ð ð:Ið Ið Ið Ið Ið Ið Ið Ið ð  ð  ð  ð  ð  ð  ð  ð  õ #œÑ*Ô*ˆJÝ ” w°ÀDÄHÀ;ÐOÑOÔOˆHØ.ˆMˆMàÔ*ˆKð ˆØ*-ˆØ*-ˆØ,Ð7�$�$°%ˆð#	$ØÐ$Ø-8¨[©]¬]Ñ*�˜làÐ+°×0EÒ0EÀgÑ0NÔ0NÐ+ÐSjÐ+Ø#/°°°Ô#4�LØÐ+°×0EÒ0EÀgÑ0NÔ0NÐ+Ø#/°°°Ô#4�Làœ�‘à3AÐ!tÀnÐWXÒFXÐFX  Õ^`Ô^t�ØÐ'Ø—N’NÑ$Ô$Ð$ð	*Ø”{Ð.Ý# D¤K°ÀÑOÔOÐOØ'+¤{×'7Ò'7Ñ'9Ô'9˜Ø”{Ð.Ø'+¤{×'7Ò'7Ñ'9Ô'9˜Ø!ŸYšY™[œ[�FàÐ+Ø ŸšÑ)Ô)Ð)øøð  Ð+Ø ŸšÑ)Ô)Ð)Ð)ð ,øøøð  Ð+°×0EÒ0EÀgÑ0NÔ0NÐ+Ø#/°°°Ô#4�LØÐ)¨j×.?Ò.?Ñ.AÔ.AÐ)Ø(Ð4Ð4Ð4Ø#0 =¡?¤?�Lð Œ{Ð&Ø”×!Ò!Ñ#Ô#Ð#ØŒ{Ð&Ø”×!Ò!Ñ#Ô#Ð#øøð Œ{Ð&Ø”×!Ò!Ñ#Ô#Ð#ØŒ{Ð&Ø”×!Ò!Ñ#Ô#Ð#Ð#ð 'øøøð Ô  FÒ*Ð*Ø—X’XÐ.Ñ/Ô/ˆFð\ð \ð \ð \ð \ð \ð
 ð 9Ý—’Ø:ØØØ�G˜LÑ)Ô)Ý Ñ-Ô-ñô ð ð ð ð 9Ý—’Ð5°v¸vÀwÀwÈ|ÑG\ÔG\Ñ]Ô]Ð]Ð]å—’˜Z¨°Ñ8Ô8Ð8ð ð 	X˜v¨š{˜{Ý!Ð"2°F¸LÈ,ÑWÔWÐWå�l¥EÑ*Ô*ð 	5Ð/?ð 	5Ý& |Ñ4Ô4ˆLð  ð 	 Ø˜L­+°lÑ*CÔ*CÐDÐDàÐsS   ÁAB$ Â$B3Â2B3Ç,H- È-IÈ2IÉIËBR Í$A*O% ÏR Ï%O>Ï>AR ÒAS
úDict[str, str]c                ó   — | j         S rª   )r!  rÄ   s    ra   ÚenvironmentzGit.environment6  s   € ØÔ Ð r‚   úDict[str, Union[str, None]]c                óÔ   — i }|                      ¦   «         D ]P\  }}|�(| j                             |¦  «        ||<   || j        |<   Œ/|| j        v r| j        |         ||<   | j        |= ŒQ|S )aß  Set environment variables for future git invocations. Return all changed
        values in a format that can be passed back into this function to revert the
        changes.

        Examples::

            old_env = self.update_environment(PWD='/tmp')
            self.update_environment(**old_env)

        :param kwargs:
            Environment variables to use for git processes.

        :return:
            Dict that maps environment variables to their old values
        )r«   r!  rB  )r™   rˆ   Úold_envr•  r  s        ra   Úupdate_environmentzGit.update_environment9  s„   € ð  ˆØ Ÿ,š,™.œ.ð 	+ð 	+‰JˆC�àÐ Ø#Ô0×4Ò4°SÑ9Ô9�˜‘Ø).�Ô! #Ñ&Ð&à˜Ô)Ð)Ð)Ø#Ô0°Ô5�˜‘ØÔ% cÐ*øØˆr‚   úIterator[None]c              +  ól   K  —  | j         di |¤Ž}	 dV —  | j         di |¤Ž dS #  | j         di |¤Ž w xY w)ag  A context manager around the above :meth:`update_environment` method to
        restore the environment back to its previous state after operation.

        Examples::

            with self.custom_environment(GIT_SSH='/bin/ssh_wrapper'):
                repo.remotes.origin.fetch()

        :param kwargs:
            See :meth:`update_environment`.
        Nr˜   )r  )r™   rˆ   r  s      ra   Úcustom_environmentzGit.custom_environmentU  sm   è è € ð *�$Ô)Ð3Ð3¨FÐ3Ð3ˆð	/ØˆEˆEˆEà#ˆDÔ#Ð.Ð. gÐ.Ð.Ð.Ð.Ð.øÐ#ˆDÔ#Ð.Ð. gÐ.Ð.Ð.Ð.øøøs   ‘$ ¤3r  r�  c                óØ   — t          |¦  «        dk    r#|du rd|z  gS |dvr|r
d|z  d|z  gS d|›|›�gS n3|du rdt          |¦  «        z  gS |dur|�d	t          |¦  «        ›d
|›�gS g S )Nrã   Tz-%sr“  z%sr•   z--%sFrw  rk  )rç   r—   )r™   rN   r  r�  s       ra   Útransform_kwargzGit.transform_kwargh  s»   € Ýˆt‰9Œ9˜Š>ˆ>Ø˜ˆ}ˆ}Ø ™�~Ð%Ø˜mÐ+Ð+Ø,ð 5Ø! D™L¨$°©,Ð7Ð7ð5ð (, t¨U¨UÐ3Ð4Ð4ð	 ,ð ˜ˆ}ˆ}Ø¥¨¡¤Ñ.Ð/Ð/Ø˜eÐ#Ð#¨Ð(9Ð(9Ý%,¨T¡]¤] ] ]°E°EÐ:Ð;Ð;Øˆ	r‚   c                óê   — g }|                      ¦   «         D ][\  }}t          |t          t          f¦  «        r |D ]}||                      |||¦  «        z  }ŒŒA||                      |||¦  «        z  }Œ\|S )z<Transform Python-style kwargs into git command line options.)r«   rW   rn   rm   r  )r™   r�  rˆ   re   r­   r®   r  s          ra   r¤  zGit.transform_kwargsx  s—   € àˆØ—L’L‘N”Nð 	Nð 	N‰DˆAˆqÝ˜!�d¥E˜]Ñ+Ô+ð NØð Vð V�EØ˜D×0Ò0°°EÐ;TÑUÔUÑU�D�DðVð ˜×,Ò,¨Q°Ð3LÑMÔMÑM��Øˆr‚   Úarg_listc                óâ   — g }t          |t          t          f¦  «        r.|D ]*}|                     |                      |¦  «        ¦  «         Œ+n"|                     t          |¦  «        ¦  «         |S rª   )rW   rn   rm   r˜  r–  rp   rO   )r  r  ÚoutlistrŽ  s       ra   r–  zGit._unpack_argsƒ  ss   € àˆÝ�h¥¥u Ñ.Ô.ð 	*Øð 6ð 6�Ø—’˜s×/Ò/°Ñ4Ô4Ñ5Ô5Ð5Ð5ð6ð �NŠN�3˜x™=œ=Ñ)Ô)Ð)àˆr‚   rš   c                ó.   —  | j         dddi|¤Ž| _        | S )ag  Specify command line options to the git executable for a subcommand call.

        :param kwargs:
            A dict of keyword arguments.
            These arguments are passed as in :meth:`_call_process`, but will be passed
            to the git command rather than the subcommand.

        Examples::

            git(work_tree='/tmp').difftool()
        r�  Tr˜   )r¤  r  r¥  s     ra   Ú__call__zGit.__call__Ž  s*   € ð 2˜DÔ1Ð[Ð[ÈDÐ[ÐTZÐ[Ð[ˆÔØˆr‚   Úmethodc                ó   — d S rª   r˜   ©r™   r  re   rˆ   s       ra   r¡  zGit._call_process�  s	   € ð ˆcr‚   ú'Git.AutoInterrupt'c                ó   — d S rª   r˜   )r™   r  r3   r4   re   rˆ   s         ra   r¡  zGit._call_process¢  s	   € ð "˜cr‚   c                ó   — d S rª   r˜   r  s       ra   r¡  zGit._call_process¬  s   € ð VYÐUXr‚   c           	     óô  — d„ |                      ¦   «         D ¦   «         }d„ |                      ¦   «         D ¦   «         }|                     dd¦  «        } | j        d
i |¤Ž}|                      d„ |D ¦   «         ¦  «        }|€||z   }	nk	 |                     |¦  «        }
n6# t
          $ r)}t          d|›dt          |¦  «        ›d�¦  «        |‚d}~ww xY w|d|
d	z   …         |z   ||
d	z   d…         z   }	| j        g}|                     | j	        ¦  «         |                     | j
        ¦  «         d
| _
        |                     t          |¦  «        ¦  «         |                     |	¦  «          | j        |fi |¤ŽS )a  Run the given git command with the specified arguments and return the result
        as a string.

        :param method:
            The command. Contained ``_`` characters will be converted to hyphens, such
            as in ``ls_files`` to call ``ls-files``.

        :param args:
            The list of arguments. If ``None`` is included, it will be pruned.
            This allows your commands to call git more conveniently, as ``None`` is
            realized as non-existent.

        :param kwargs:
            Contains key-values for the following:

            - The :meth:`execute()` kwds, as listed in ``execute_kwargs``.
            - "Command options" to be converted by :meth:`transform_kwargs`.
            - The ``insert_kwargs_after`` key which its value must match one of
              ``*args``.

            It also contains any command options, to be appended after the matched arg.

        Examples::

            git.rev_list('master', max_count=10, header=True)

        turns into::

            git rev-list --max-count=10 --header master

        :return:
            Same as :meth:`execute`. If no args are given, used :meth:`execute`'s
            default (especially ``as_process = False``, ``stdout_as_string = True``) and
            return :class:`str`.
        c                ó,   — i | ]\  }}|t           v ¯||“ŒS r˜   ©Úexecute_kwargs©r    r­   r®   s      ra   r¢   z%Git._call_process.<locals>.<dictcomp>Ù  s(   € ÐNÐNÐN¡  1¸!½~Ð:MÐ:M�q˜!Ð:MÐ:MÐ:Mr‚   c                ó,   — i | ]\  }}|t           v¯||“ŒS r˜   r$  r&  s      ra   r¢   z%Git._call_process.<locals>.<dictcomp>Ú  s(   € ÐRÐRÐR¡  1¸!Å>Ð:QÐ:Q�q˜!Ð:QÐ:QÐ:Qr‚   Úinsert_kwargs_afterNc                ó   — g | ]}|®|‘ŒS rª   r˜   )r    Úas     ra   rŒ  z%Git._call_process.<locals>.<listcomp>á  s   € Ð%GÐ%GÐ%G¨A¸¸ a¸¸¸r‚   zCouldn't find argument 'z
' in args z to insert cmd options afterrã   r˜   )r«   Úpopr¤  r–  ÚindexrÐ   rO   r)  r˜  r   r  rp   r—   rÁ  )r™   r  re   rˆ   Úexec_kwargsÚopts_kwargsÚinsert_after_this_argÚopt_argsÚext_argsÚ	args_listr,  rP  Úcalls                ra   r¡  zGit._call_process±  s¼  € ðP OÐN¨¯ª©¬ÐNÑNÔNˆØRÐR¨¯ª©¬ÐRÑRÔRˆà +§¢Ð0EÀtÑ LÔ LÐð )�4Ô(Ð7Ð7¨;Ð7Ð7ˆØ×$Ò$Ð%GÐ%G°Ð%GÑ%GÔ%GÑHÔHˆà Ð(Ø  8Ñ+ˆIˆIðØ ŸšÐ'<Ñ=Ô=��øÝð ð ð Ý �jà,Ð,Ð,­c°(©m¬m¨m¨mð=ñô ð ðøøøøðøøøð !  5¨1¡9 Ô-°Ñ8¸8ÀEÈAÁIÀKÀKÔ;PÑPˆIð Ô.Ð/ˆð 	�Š�DÔ0Ñ1Ô1Ð1ð 	�Š�DÔ%Ñ&Ô&Ð&ØˆÔà�Š•G˜F‘O”OÑ$Ô$Ð$Ø�Š�IÑÔÐàˆtŒ|˜DÐ0Ð0 KÐ0Ð0Ð0s   ÂB Â
CÂ($CÃCÚheader_lineúTuple[str, str, int]c                ó�  — |                      ¦   «         }t          |¦  «        dk    rQ|s"d| j        › d| j        › d�}t          |¦  «        ‚t          d|d         ›d|                     ¦   «         ›�¦  «        ‚t          |d         ¦  «        dk    rt          d	|z  ¦  «        ‚|d         |d
         t          |d         ¦  «        fS )a.  
        :param header_line:
            A line of the form::

                <hex_sha> type_string size_as_int

        :return:
            (hex_sha, type_string, size_as_int)

        :raise ValueError:
            If the header contains indication for an error due to incorrect input sha.
        r)   z>SHA is empty, possible dubious ownership in the repository at zj.
            If this is unintended run:

                      "git config --global --add safe.directory z" zSHA r   z& could not be resolved, git returned: é(   zFailed to parse header: %rrã   r±  )ro   rç   r  rÐ   Ústripr´   )r™   r4  ÚtokensÚerr_msgs       ra   Ú_parse_object_headerzGit._parse_object_headerÿ  sð   € ð ×"Ò"Ñ$Ô$ˆÝˆv‰;Œ;˜!ÒÐØð vðhØ Ô-ðhð hàPTÔPaðhð hð hð õ
 ! Ñ)Ô)Ð)å �jÐU[Ð\]ÔU^ÐU^ÐU^Ð`k×`qÒ`qÑ`sÔ`sÐ`sÐ!tÑuÔuÐuõ ˆv�aŒy‰>Œ>˜RÒÐÝÐ9¸KÑGÑHÔHÐHØ�q”	˜6 !œ9¥c¨&°¬)¡n¤nÐ5Ð5r‚   Úrefr   c                ó  — t          |t          ¦  «        r|                     d¦  «        }n't          |t          ¦  «        st          |¦  «        }n|}|                     d¦  «        s|dz  }|                     t          ¦  «        S )NÚasciirí  )rW   rX   rY   rO   rÿ  rz   r
   )r™   r<  Úrefstrs      ra   Ú_prepare_refzGit._prepare_ref  sz   € å�c�5Ñ!Ô!ð 	àŸ*š* WÑ-Ô-ˆFˆFÝ˜C¥Ñ%Ô%ð 	Ý˜‘X”XˆFˆFàˆFà�Š˜tÑ$Ô$ð 	Ø�d‰NˆFØ�}Š}�VÑ$Ô$Ð$r‚   Ú	attr_nameÚcmd_namec                óÐ   — t          | |¦  «        }|�|S t          ddœ}|                     |¦  «          | j        |g|¢R i |¤Ž}t	          | ||¦  «         t          d|¦  «        }|S )NT)r3   r4   rd   )rl   r   rø  r¡  r¬   r'   )r™   rA  rB  re   rˆ   Úcur_valrq  Úcmds           ra   Ú_get_persistent_cmdzGit._get_persistent_cmd,  s„   € Ý˜$ 	Ñ*Ô*ˆØÐØˆNå"°$Ð7Ð7ˆØ�Š�vÑÔÐà ˆdÔ  Ð<¨DÐ<Ð<Ð<°GÐ<Ð<ˆÝ��i Ñ%Ô%Ð%ÝÐ&¨Ñ,Ô,ˆØˆ
r‚   rE  c                ó   — |j         ry|j        rr|j                              |                      |¦  «        ¦  «         |j                              ¦   «          |                      |j                             ¦   «         ¦  «        S t          d¦  «        ‚)Nzcmd stdin was empty)r»   rg   Úwriter@  Úflushr;  rë   rÐ   )r™   rE  r<  s      ra   Ú__get_object_headerzGit.__get_object_header9  sz   € ØŒ9ð 	4˜œð 	4ØŒI�OŠO˜D×-Ò-¨cÑ2Ô2Ñ3Ô3Ð3ØŒI�OŠOÑÔÐØ×,Ò,¨S¬Z×-@Ò-@Ñ-BÔ-BÑCÔCÐCåÐ2Ñ3Ô3Ð3r‚   c                ó^   — |                       ddd¬¦  «        }|                      ||¦  «        S )aD  Use this method to quickly examine the type and size of the object behind the
        given ref.

        :note:
            The method will only suffer from the costs of command invocation once and
            reuses the command in subsequent calls.

        :return:
            (hexsha, type_string, size_as_int)
        r  Úcat_fileT)Úbatch_check)rF  Ú_Git__get_object_header)r™   r<  rE  s      ra   Úget_object_headerzGit.get_object_headerA  s6   € ð ×&Ò&Ð'8¸*ÐRVÐ&ÑWÔWˆØ×'Ò'¨¨SÑ1Ô1Ð1r‚   úTuple[str, str, int, bytes]c                ón   — |                       |¦  «        \  }}}}|                     |¦  «        }~||||fS )zÉSimilar to :meth:`get_object_header`, but returns object data as well.

        :return:
            (hexsha, type_string, size_as_int, data_string)

        :note:
            Not threadsafe.
        )Ústream_object_datarÏ   )r™   r<  ÚhexshaÚtypenamerà   rP   rË   s          ra   Úget_object_datazGit.get_object_dataO  sC   € ð *.×)@Ò)@ÀÑ)EÔ)EÑ&ˆ�˜$ Ø�{Š{˜4Ñ Ô ˆØØ˜ $¨Ð-Ð-r‚   ú0Tuple[str, str, int, 'Git.CatFileContentStream']c                óÜ   — |                       ddd¬¦  «        }|                      ||¦  «        \  }}}|j        �|j        nt          j        ¦   «         }||||                      ||¦  «        fS )a$  Similar to :meth:`get_object_data`, but returns the data as a stream.

        :return:
            (hexsha, type_string, size_as_int, stream)

        :note:
            This method is not threadsafe. You need one independent :class:`Git`
            instance per thread to be safe!
        r  rL  T)Úbatch)rF  rN  rg   r  ÚBytesIOrù   )r™   r<  rE  rS  rT  rà   Ú
cmd_stdouts          ra   rR  zGit.stream_object_data]  sq   € ð ×&Ò& ~°zÈÐ&ÑNÔNˆØ!%×!9Ò!9¸#¸sÑ!CÔ!CÑˆ�˜$Ø#&¤:Ð#9�S”Z�Z½r¼z¹|¼|ˆ
Ø˜ $¨×(AÒ(AÀ$È
Ñ(SÔ(SÐTÐTr‚   c                óp   — | j         | j        fD ]}|r|                     ¦   «          Œd| _         d| _        | S )z Clear all kinds of internal caches to release resources.

        Currently persistent commands will be interrupted.

        :return:
            self
        N)r  r  rÅ   )r™   rE  s     ra   Úclear_cachezGit.clear_cachel  sI   € ð Ô% tÔ';Ð<ð 	ð 	ˆCØð Ø—’‘”�øà ˆÔØ#ˆÔØˆr‚   )rI   r�   )r¦   r�   rI   rJ   rª   )r+  r,  rI   rG   )rI   rG   )..)rU  rO   rT  rV  rW  rG   rI   rO   )NT)rU  rO   rT  r[  rW  rG   rI   rO   )rU  rO   rT  r[  rW  rG   rI   r-   )rU  rO   rI   rJ   )ri  rO   rI   rO   )rp  )rq  rM   rr  rM   rs  rO   rI   rJ   )r˜   N)re   rˆ  rˆ   r‰  rI   rM   )r›  r,  rI   rJ   r  )rˆ   r   rI   rJ   )re   r   r§  rG   rˆ   r   rI   r¨  )rI   r,  )rI   r®  )r…   r†   r4   r¾  rI   r¿  )r…   r†   r4   rV  r9   r¾  rI   rÂ  )r…   r†   r4   rV  r9   rV  rI   rÅ  )
r…   r†   r<   rV  r4   rV  r9   r¾  rI   rO   )
r…   r†   r<   rV  r4   rV  r9   rV  rI   rX   ) r…   r†   r3   rÊ  r<   rG   r8   rG   r4   rG   r6   rÊ  r9   rG   r:   rH   r5   rG   r;   rG   r2   r[  r1   rË  r7   r´   r=   rG   rÌ  r   rI   rÍ  )rI   r
  )rˆ   r   rI   r  )rˆ   r   rI   r  )rN   rO   r  r   r�  rG   rI   rM   )T)r�  rG   rˆ   r   rI   rM   )r  rˆ  rI   rM   )rˆ   r   rI   rš   )r  rO   re   rJ   rˆ   rJ   rI   rO   )r  rO   r3   r´   r4   r¾  re   r   rˆ   r   rI   r  )r  rO   re   r   rˆ   r   rI   r¨  )r4  rO   rI   r5  )r<  r   rI   rX   )
rA  rO   rB  rO   re   r   rˆ   r   rI   r  )rE  r  r<  r   rI   r5  )r<  rO   rI   r5  )r<  rO   rI   rP  )r<  rO   rI   rV  )rI   rš   )DrÖ   r×   rØ   rÙ   r£   r#  ÚreÚcompilerd  r«  Ú%unsafe_git_pathspec_from_file_optionsr$  r&  rD  r¿   rA  rB  r(  r  rÚ   rC  rH  r)  r¥   rE  ÚclassmethodrR  rT  r(   rZ  rh  ro  r‡  rš  r±   rw   rÜ   rù   r¸   r  rÈ   r¦  rª  Úpropertyr›  r½  rÁ  r  r  r  r  Ú
contextlibÚcontextmanagerr  r  r¤  r–  r  r¡  r;  r@  rF  rN  rO  rU  rR  r\  r  r  s   @ra   r   r   h  s*  ø€ € € € € € ðð ð	€Ið€Jð $˜œ KÑ0Ô0Ðð 	Øð$Ð ð 	ð-Ð)ð<ð <ð <ð <ðPð Pð Pð Pð
 €MØTà”z—~’~Ð&8¸%Ñ@Ô@ÐØ8à€IÐÐÐÑð.ð` 4ÐØ+Ðà $Ððð �V‘X”X€Nàðcð cð cð cñ „[ðcðJ ð<ð <ð <ñ „[ð<ð ØØgÐgÐgÐgñ „[ñ „XàgàØØlÐlÐlÐlñ „[ñ „Xàlàðð ð ð ñ „[ðð0 ðð ð ñ „[ðð& ð)ð )ð )ñ „[ð)ð à]gð>ð >ð >ð >ñ „[ð>ð@ ðð ð ð ñ „[ðð8  .€MÐ-Ð-Ð-Ñ-à&;ÐÐ;Ð;Ð;Ñ;ð3ð 3ð 3ð 3ð 3ð 3ð 3ð2.ð .ð .ð .ð .ð .ð
	Qð 	Qð 	Qð 	Qð 	Qð 	Qð
gð 
gð 
gð 
gð &+ð@ð @ð @ð @ð @ð @ð  ð!ð !ð !ñ „Xð!ð ð"ð "ð "ñ „Xð"ð6 ðð ð ñ „Xðð ð
 &+ð	/ð /ð /ð /ð /ñ „Xð/ð ð
 &+Ø+0ð3ð 3ð 3ð 3ð 3ñ „Xð3ð ðð ð ñ „Xðð ðð ð ñ „Xðð *.Ø%*Ø $Ø Ø/3Ø!%Ø15Ø Ø#(Ø#'Ø.2Ø Ô4Ø(,ðk ð k ð k ð k ð k ð k ð k ðZ!ð !ð !ð !ðð ð ð ð8 Ôð/ð /ð /ñ Ôð/ð$ð ð ð ð 	ð 	ð 	ð 	ð 	ð ðð ð ñ „[ððð ð ð ð ðð ð ñ „Xðð ð"ð "ð "ñ „Xð"ð ðYð Yð Yñ „XðYðL1ð L1ð L1ð L1ð\6ð 6ð 6ð 6ð>%ð %ð %ð %ðð ð ð ð4ð 4ð 4ð 4ð2ð 2ð 2ð 2ð.ð .ð .ð .ðUð Uð Uð Uðð ð ð ð ð ð ð r‚   )Ú	metaclass)NTN)r>   r?   r@   rA   rB   rC   rD   rE   rF   rG   r:   rH   rI   rJ   )
r…   r†   r2   rG   r1   r‡   rˆ   r   rI   r   )r’   rO   rI   rO   )r˜   )r™   rš   r›   rœ   rI   r�   )r™   r¥   r¦   r§   r¨   rœ   rI   rJ   )rú   rG   rI   rJ   )WÚ
__future__r   Ú__all__rb  r  r´  Úloggingr¿   r]  rÙ  r�   r   r   r   rù  Útextwrapr	   rq   rý   Ú
git.compatr
   r   r   Úgit.excr   r   r   r   r   Úgit.utilr   r   r   r   r   r   Útypingr   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r½  r+   Útyping_extensionsÚ	git.typesr,   r-   r.   Úgit.diffr/   Úgit.repo.baser0   r%  Ú	getLoggerrÖ   r[   r�   rÚ   rú  r‘   rƒ   r—   r¤   r¯   r±   rØ   rÜ   r   rÿ   r  Útyper  r   r   r˜   r‚   ra   ú<module>rs     sÎ  ðð #Ð "Ð "Ð "Ð "Ð "Ð "à�eÐ
€à Ð Ð Ð Ø 	€	€	€	Ø Ð Ð Ð Ø €€€Ø 	€	€	€	Ø 	€	€	€	Ø €€€Ø Ð Ð Ð Ø +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ð +Ø 
€
€
€
Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ø €€€à 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7Ð 7ðð ð ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ðð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð ð( Ô�wÒÐØ Ð Ð Ð Ð Ð Ð à+Ð+Ð+Ð+Ð+Ð+à ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,Ð ,àð #Ø"Ð"Ð"Ð"Ð"Ð"Ø"Ð"Ð"Ð"Ð"Ð"ðð ð €ð  ˆ'Ô
˜HÑ
%Ô
%€ð& SWØØ-1ð|ð |ð |ð |ð |ð~ "Ð !Ð !Ñ !à„<�7ÒÐð
 Ø+/ð	;ð ;ð ;ð ;ð ;ð ;ðz '€K€Kà€Kð$ð $ð $ð $ðMð Mð Mð Mð Mðð ð ð ð ðkð kð kð kð kñ kô kð kð\ *€Ô Ø1€Ô ði.ð i.ð i.ð i.ð i.ñ i.ô i.ð i.ðZ "8Ð Ô Ø%?Ð Ô "ð.ð ð/ð ðð ð ð ð ð  ð  ð  ð  ˆtñ  ô  ð  ð2 €ðð2Rð Rð Rð Rð R�Hð Rñ Rô Rð Rð Rð Rr‚   