HEX
Server: LiteSpeed
System: Linux s787.bom1.mysecurecloudhost.com 4.18.0-477.13.1.lve.el8.x86_64 #1 SMP Thu Jun 1 16:40:47 EDT 2023 x86_64
User: mobilech (5348)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //opt/saltstack/salt/lib/python3.10/site-packages/git/__pycache__/config.cpython-310.pyc
o

;j$��@s6UdZddgZddlZddlZddlZddlmZddlZddl	m
Z
mZddlZddl
Z
ddlmZddlZddlZddlmZmZddlmZdd	lmZmZmZmZmZmZmZm Z m!Z!m"Z"m#Z#m$Z$dd
l%m&Z&m'Z'm(Z(m)Z)m*Z*e r�ddl	m+Z+ddl,m-Z-e"d
dd�Z.e"de/e0e1e2e3�Z4ej5dd�dkr�ddl6m7Z7e7Z8nddlm7Z7e7e/ee4fZ8e�9e:�Z;dZ<e'e=d<	e�>d�Z?	e�>d�Z@	Gdd�dejA�ZBdede*fdede*ffdd�ZCdede*fdede*ffdd �ZDGd!d�dee.�ZEGd"d#�d#e8�ZFd$e&de/fd%d&�ZGGd'd�dejHeBd(�ZIdS))z3Parser for reading and writing configuration files.�GitConfigParser�SectionConstraint�N)�wraps)�BufferedReader�IOBase)�defenc�
force_text)�LockFile)�Any�Callable�Generic�IO�List�Dict�Sequence�
TYPE_CHECKING�Tuple�TypeVar�Union�cast)�Lit_config_levels�ConfigLevels_Tup�PathLike�assert_never�_T)�BytesIO)�Repo�T_ConfigParser)�bound�T_OMD_value�)r ��)�OrderedDict)�system�user�global�
repository�
CONFIG_LEVELSzL(?<=includeIf )\"(gitdir|gitdir/i|onbranch|hasconfig:remote\.\*\.url):(.+)\"z
[\r\n\x00]cs:eZdZdZdededeeefddf�fdd�Z�Z	S)�MetaParserBuilderz_Utility class wrapping base-class methods into decorators that assure read-only
    properties.�name�bases�clsdict�returncs�d}||vr7||}|D]*}dd�t�|tj�D�}|D]\}}	||vr%qt|	�}
||vr1t|
�}
|
||<qqt��||||�}|S)z�Equip all base-class methods with a needs_values decorator, and all non-const
        methods with a :func:`set_dirty_and_flush_changes` decorator in addition to
        that.
        �_mutating_methods_css"�|]}|d�d�s|VqdS)r�_N��
startswith)�.0�t�r4�>/opt/saltstack/salt/lib/python3.10/site-packages/git/config.py�	<genexpr>\s� z,MetaParserBuilder.__new__.<locals>.<genexpr>)�inspect�
getmembersZ	isroutine�needs_values�set_dirty_and_flush_changes�super�__new__)�clsr*r+r,ZkmmZmutating_methods�base�methods�method_name�methodZmethod_with_values�new_type��	__class__r4r5r<Ss
�
zMetaParserBuilder.__new__)
�__name__�
__module__�__qualname__�__doc__�strrrr
r<�
__classcell__r4r4rCr5r)Os.r)�func.r-c	s*t��dddtdtdtf�fdd��}|S)zYReturn a method for ensuring we read values (on demand) before we try to access
    them.�selfr�args�kwargsr-cs|���|g|�Ri|��S�N)�read)rLrMrN�rKr4r5�assure_data_presentrsz)needs_values.<locals>.assure_data_present)rr
r)rKrRr4rQr5r9ns r9�non_const_funccs*dddtdtdtf�fdd�}�j|_|S)z�Return a method that checks whether given non constant function may be called.

    If so, the instance will be set dirty. Additionally, we flush the changes right to
    disk.
    rLrrMrNr-cs(�|g|�Ri|��}d|_|��|S)NT)�_dirty�write)rLrMrNZrval�rSr4r5�
flush_changes�sz2set_dirty_and_flush_changes.<locals>.flush_changes)r
rrE)rSrWr4rVr5r:{sr:cs�eZdZdZdZdZdededdfdd	�Zd d
d�Z	dede
f�fd
d�Zdede
de
de
fdd�Ze
defdd��Zd dd�Zd!dd�Zdedededdfdd�Z�ZS)"ra'Constrains a ConfigParser to only option commands which are constrained to
    always use the section we have been initialized with.

    It supports all ConfigParser methods that operate on an option.

    :note:
        If used as a context manager, will release the wrapped ConfigParser.
    ��_config�
_section_name)�	get_value�	set_value�get�setZgetintZgetfloatZ
getbooleanZ
has_option�remove_section�
remove_option�options�config�sectionr-NcCs||_||_dSrOrX)rLrbrcr4r4r5�__init__�s
zSectionConstraint.__init__cCs|j��dSrO�rY�release�rLr4r4r5�__del__�szSectionConstraint.__del__�attrcs$��jvr��fdd�St����S)Ncs�j�g|�Ri|��SrO)�_call_config)rMrN�rirLr4r5�<lambda>��z/SectionConstraint.__getattr__.<locals>.<lambda>)�
_valid_attrs_r;�__getattribute__)rLrirCrkr5�__getattr__�s
zSectionConstraint.__getattr__rArMrNcOs t|j|�|jg|�Ri|��S)zdCall the configuration at the given method which must take a section name as
        first argument.)�getattrrYrZ)rLrArMrNr4r4r5rj�s zSectionConstraint._call_configcC�|jS)z*return: ConfigParser instance we constrain)rYrgr4r4r5rb��zSectionConstraint.configcCs
|j��S)ziEquivalent to :meth:`GitConfigParser.release`, which is called on our
        underlying parser instance.rergr4r4r5rf�s
zSectionConstraint.release�!SectionConstraint[T_ConfigParser]cCs|j��|SrO)rY�	__enter__rgr4r4r5ru�s
zSectionConstraint.__enter__�exception_type�exception_value�	tracebackcCs|j�|||�dSrO)rY�__exit__)rLrvrwrxr4r4r5ry��zSectionConstraint.__exit__�r-N)r-rt)rErFrGrH�	__slots__rnrrIrdrhr
rprj�propertyrbrfruryrJr4r4rCr5r�s	


"c	s*eZdZdZdededdf�fdd�Zdededdf�fdd	�Zded
e	eddf�fdd�Z
dedef�fd
d�Zdedef�fdd�Zdededdf�fdd�Z
ddedeedfdeedff�fdd�
Zdede	ef�fdd�Zde	eeeffdd�Zde	eee	effdd�Z�ZS)�_OMDzOrdered multi-dict.�key�valuer-Ncst��||g�dSrO�r;�__setitem__�rLrr�rCr4r5r��rzz_OMD.__setitem__cs2||vrt��||g�dSt��|��|�dSrO)r;r��__getitem__�appendr�rCr4r5�add�sz_OMD.add�valuescst��||�dSrOr�)rLrr�rCr4r5�setall��z_OMD.setallc�t��|�dS�N����r;r��rLrrCr4r5r���z_OMD.__getitem__cr�r�r�r�rCr4r5�getlast�r�z_OMD.getlastcs4||vrt��||g�dSt��|�}||d<dSr�)r;r�r�)rLrr�ZpriorrCr4r5�setlast�s
z_OMD.setlast�defaultcst��||g�dSr�)r;r])rLrr�rCr4r5r]�rzz_OMD.getcst��|�SrOr�r�rCr4r5�getall��z_OMD.getallc��fdd��D�S)z"List of (key, last value for key).csg|]}|�|f�qSr4r4�r2�krgr4r5�
<listcomp>�rmz_OMD.items.<locals>.<listcomp>r4rgr4rgr5�items��z
_OMD.itemscr�)z&List of (key, list of values for key).csg|]	}|��|�f�qSr4)r�r�rgr4r5r��sz"_OMD.items_all.<locals>.<listcomp>r4rgr4rgr5�	items_all�r�z_OMD.items_allrO)rErFrGrHrIrr�r
r�rr�r�r�r�rr]r�rr�r�rJr4r4rCr5r~�s,&r~�config_levelc	Cs�tjdkr|dkrd}|dkrdS|dkr3tj�d�p%t�tj�dd�d	�}t�t�t�|d
d���S|dkr?t�t�d��S|d
krGt	d��t
|t	d|����dS)N�win32r$r&z/etc/gitconfigr%ZXDG_CONFIG_HOME�HOME�~z.config�gitrbz~/.gitconfigr'zGNo repo to get repository configuration from. Use Repo._get_config_pathzInvalid configuration level: )�sys�platform�os�environr]�osp�join�normpath�
expanduser�
ValueErrorr)r�Zconfig_homer4r4r5�get_config_path�s"�r�cs|eZdZdZeZ	e�d�ZdZ	e�e	�Z
e�e	dd�Z[	dZ						dXd	e
ded
ee
ed
ffdeded
e
edfde
dddfdd�ZdYdd�ZdYdd�ZdZdd�Zdeddfdd�ZdYdd�Zdedefdd �Zd!e
eeefd"eddfd#d$�Zde
eeffd%d&�Z de!e"eeffd'd(�Z#dYd)d*�Z$d!eddfd+d,�Z%d-ede!e"eeff�fd.d/�Z&d-ede!e"ee!effd0d1�Z'e(dYd2d3��Z)d4eddfd5d6�Z*d[�fd9d:�Z+e,defd;d<��Z-	d\d7ed=ed>e
ee.eedfde
ee.eeffd?d@�Z/	d\d7ed=ed>e
ee.eedfde!e
ee.eeffdAdB�Z0dCede
ee.eeffdDdE�Z1dFe
eeee.efdefdGdH�Z2dFe
eeee.efdefdIdJ�Z3dKd8dLeddfdMdN�Z4e(e5	d\d7ed=edFe
eeee.edfddf�fdOdP�
��Z6e(e5d7ed=edFe
eeee.efddf�fdQdR���Z7e(e5d7ed=edFe
eeee.efddfdSdT���Z8d7edUeddf�fdVdW�Z9�Z:S)]ra�Implements specifics required to read git style configuration files.

    This variation behaves much like the :manpage:`git-config(1)` command, such that the
    configuration will be read on demand based on the filepath given during
    initialization.

    The changes will automatically be written once the instance goes out of scope, but
    can be triggered manually as well.

    The configuration file will be locked if you intend to change values preventing
    other instances to write concurrently.

    :note:
        The config is case-sensitive even when queried, hence section and option names
        must match perfectly.

    :note:
        If used as a context manager, this will release the locked file.
    z^\s*[#;]z\s*(?P<option>[^:=\s][^:=]*)z\s*(?P<vi>[:=])\s*z(?P<value>.*)$)�add_sectionr_r`r^NT�
file_or_filesr�	read_only�merge_includesr��repo)rNr-cCs�tjj|td�|||t|d�s|��|_|dur ||_n|dur3|r/dd�tD�|_n
t	d��t
|�g|_||_d|_d|_
||_||_d|_|��dS)a�Initialize a configuration reader to read the given `file_or_files` and to
        possibly allow changes to it by setting `read_only` False.

        :param file_or_files:
            A file path or file object, or a sequence of possibly more than one of them.

        :param read_only:
            If ``True``, the ConfigParser may only read the data, but not change it.
            If ``False``, only a single file path or file object may be given. We will
            write back the changes when they happen, or when the ConfigParser is
            released. This will not happen if other configuration files have been
            included.

        :param merge_includes:
            If ``True``, we will read files mentioned in ``[include]`` sections and
            merge their contents into ours. This makes it impossible to write back an
            individual configuration file. Thus, if you want to modify a single
            configuration file, turn this off to leave the original dataset unaltered
            when reading it.

        :param repo:
            Reference to repository to use if ``[includeIf]`` sections are found in
            configuration files.
        )Z	dict_type�_proxiesNcSs"g|]
}|dkrttt|���qS)r')r�rr)r2�fr4r4r5r�msz,GitConfigParser.__init__.<locals>.<listcomp>z7No configuration level or configuration files specifiedF)�cp�RawConfigParserrdr~�hasattr�_dictr��_file_or_filesr(r�r��
_read_onlyrT�_is_initialized�_merge_includes�_repo�_lock�
_acquire_lock)rLr�r�r�r�r�r4r4r5rd>s, 


�zGitConfigParser.__init__cCsf|js1|js*t|jttjf�r|j}nt|jttt	f�r t
d��|jj}|�|�|_|j�
�dSdS)NzVWrite-ConfigParsers can operate on a single file only, multiple files have been passed)r�r��
isinstancer�rIr�r�tuple�listrr�r*�t_lock�_obtain_lock)rLr�r4r4r5r�}s��zGitConfigParser._acquire_lockcCs|��dS)z4Write pending changes if required and release locks.N�rfrgr4r4r5rh�szGitConfigParser.__del__cCs|��|SrO)r�rgr4r4r5ru�szGitConfigParser.__enter__rMcGs|��dSrOr�)rLrMr4r4r5ry�r�zGitConfigParser.__exit__cCs�|js|jr
|j��s
dSz.z|��Wnty$tjddd�Yn	ty,YnwW|jdur:|j��dSdS|jdurG|j��ww)aFlush changes and release the configuration write lock. This instance must
        not be used anymore afterwards.

        In Python 3, it's required to explicitly release locks and flush changes, as
        ``__del__`` is not called deterministically anymore.
        Nz/Exception during destruction of GitConfigParserT)�exc_info)	r�r�Z	_has_lockrU�IOError�_logger�error�ReferenceErrorZ
_release_lockrgr4r4r5rf�s	��
��zGitConfigParser.release�	optionstrcCs|S)z1Do not transform options in any way when writing.r4)rLr�r4r4r5�optionxform�szGitConfigParser.optionxform�fp�fpnamecCs�d}d}d}d}d}dtdtfdd�}	|���t�}	|	s�n+|d	}|	��d
ks/|j�|	�r0q|	�dd	�d��dkrC|	ddvrCq|j	�|	���}
|s|
r|
�
d
���}||jvra|j|}n|tj
krj|j}n|�d|ff�}||j|<d|j|<d}n�|dur�t�|||	��|�s(|j�|	�}
|
�r|
�
ddd�\}}}
|�|���}|dvr�d|
vr�|
���d�s�|
�d�}|dkr�|
|d	��r�|
d|�}
|
��}
t|
�dks�|
ddkr�n+|
ddkr�d}||
d	d��}
n|
�dd	d�dk�r	|
�dd	d�dk�r	|
d	d�}
|�||
�n9|j�|	��s'|�st�|�}|�|t|	��q|	��}	|	�d��r:d}|	dd�}	|�|�}
|� ||
||	��q|�rO|�dS)a�Originally a direct copy of the Python 2.4 version of
        :meth:`RawConfigParser._read <configparser.RawConfigParser._read>`, to ensure it
        uses ordered dicts.

        The ordering bug was fixed in Python 2.4, and dict itself keeps ordering since
        Python 3.7. This has some other changes, especially that it ignores initial
        whitespace, since git uses tabs. (Big comments are removed to be more compact.)
        NrF�vr-cSs*|r
|�d�r
|dd�}|�t��d�S)N�\r�Zunicode_escape)�endswith�encoder�decode)r�r4r4r5�
string_decode�sz,GitConfigParser._read.<locals>.string_decodeT���remZrR�headerrE�option�vir�)�=�:�;�"r�r"r�)!rI�readliner�r�strip�
re_comment�match�split�lowerZSECTCRE�group�	_sectionsr��DEFAULTSECT�	_defaultsr�r�ZMissingSectionHeaderError�OPTCREr��rstripr1�find�isspace�lenr��OPTVALUEONLYZParsingErrorr��reprr�r�r�)rLr�r�ZcursectZoptname�linenoZ
is_multi_line�er��line�moZsectnamer�Zoptval�posr4r4r5�_read�sz		$




(

�M�zGitConfigParser._readcCs|jot|���SrO)r�r��_included_pathsrgr4r4r5�
_has_includes"r�zGitConfigParser._has_includesc	s�dtdttttff�fdd�}g}���D]�}|dkr#|||�7}t�|�}|dus1�jdur2q|�d�}|�d����|d	vr�t	�
���t�fd
d�dD��sVd
����d�r_�d7�|�d�rmt
�ddd�����jjr�t�t��jj���r�|||�7}q|dkr�z�jjj}Wn	ty�Yqwt�|��r�|||�7}q|dkr��jjD]}t�|j��r�|||�7}nq�q|S)z�List all paths that must be included to configuration.

        :return:
            The list of paths, where each path is a tuple of (option, value).
        rcr-csdd��j|��D�S)zFReturn all (key, value) pairs for a section, including duplicate keys.cSs*g|]\}}|dkr|D]}||f�qqS�rEr4)r2rr�r�r4r4r5r�.s��zGGitConfigParser._included_paths.<locals>._all_items.<locals>.<listcomp>)r�r�)rcrgr4r5�
_all_items,s�z3GitConfigParser._included_paths.<locals>._all_items�includeNr�r")Zgitdirzgitdir/ic3s�|]}��|�VqdSrOr0)r2�s)r�r4r5r6Es�z2GitConfigParser._included_paths.<locals>.<genexpr>)z./�/z**/r�z**z/iz[a-zA-Z]cSs d|�����|�����d�S)N�[�])r�r��upper)�mr4r4r5rlN� z1GitConfigParser._included_paths.<locals>.<lambda>Zonbranchzhasconfig:remote.*.url)rIrr�sections�CONDITIONAL_INCLUDE_REGEXP�searchr�r�r�r�r��anyr��re�subZgit_dir�fnmatch�fnmatchcaser��fspathZ
active_branchr*�	TypeErrorZremotes�url)rLr��pathsrcr��keywordZbranch_nameZremoter4�rLr�r5r�%sV"	




������zGitConfigParser._included_pathsc	Cs�|jrdSd|_dg}t|jttjf�r|jg}nt|jtttf�s'|jg}nt|j�}t	|�}d}|r�|�
d�}d}t|d�rOtt
t|�}|�||j�n*z t|d��}d}|�||j�Wd�n1siwYWn	tyxYq2w|��r�|��D]M\}}|�d�r�t�|�}t�|�s�|s�q�tt|�}t�|�s�Jd	��t�t�|�|�}t�|�}||vs�t�|tj�s�q�|�|�|�d|�|d
7}q�|s4|dkr�d|_ dSdS)z�Read the data stored in the files we have been initialized with.

        This will ignore files that cannot be read, possibly leaving an empty
        configuration.

        :raise IOError:
            If a file cannot be handled.
        NTr�rF�seek�rbr�z9Need absolute paths to be sure our cycle checks will workr�)!r�r�r�rIr�rr�r�rr^�popr�rr
�bytesr�r*�openr�r�r�r1r�r��isabsr��dirnamer��access�R_OKr��insertr�)	rLZ
files_to_read�seenZnum_read_include_filesZ	file_pathZfile_okr�r/Zinclude_pathr4r4r5rPes\	




���






�,
�zGitConfigParser.readcsRdtdtddf��fdd�}�jr|tj�j��j��D]	\}}|||�qdS)z`Write an .ini-format representation of the configuration state in
        git compatible format.r*�section_dictr-Nc
sd��d|�t��|��D]!\}}|dkrq|D]}��d|��|��dd�f�t��qqdS)Nz[%s]
rEz		%s = %s
�
z
	)rUr�rr��_value_to_string�replace)r*rrr�r��r�rLr4r5�
write_section�s(��z-GitConfigParser._write.<locals>.write_section)rIr~r�r�r�r�r�)rLr�rr*r�r4rr5�_write�s�zGitConfigParser._write�section_namecsdd�t��|�D�S)zK:return: list((option, value), ...) pairs of all items in the given sectioncSs g|]\}}|dkr||f�qSr�r4)r2r�r�r4r4r5r��r�z)GitConfigParser.items.<locals>.<listcomp>)r;r�)rLrrCr4r5r��szGitConfigParser.itemscCsbt|j�}|j|��D] \}}|dkrq||vr!|�|�|kr!q|D]}|�||�q#q|��S)zQ:return: list((option, [values...]), ...) pairs of all items in the given sectionrE)r~r�r�r�r�r�)rLr�rvr��vsr�r4r4r5r��s
�zGitConfigParser.items_allcCs�|�d�|js
dSt|jttf�rtdt|j���|��r&t	�
d�dS|j}t|ttj
tf�}|r>|jdur>|j��t|d�sett
|�}t|d��}|�|�Wd�dS1s^wYdStd|�}|�d�t|d	�rx|��|�|�dS)
z�Write changes to our file, if there are changes at all.

        :raise IOError:
            If this is a read-only writer instance or if we could not obtain a file
            lock.
        rUNzRCannot write back if there is not exactly a single file to write to, have %i fileszsSkipping write-back of configuration file as include files were merged in.Set merge_includes=False to prevent this.r
�wbrr�truncate)�_assure_writablerTr�r�r�r��AssertionErrorr�r�r��debugrIr�rrr�r�r�rrrr
r#)rLr�Zis_file_lockZfp_openr4r4r5rU�s8
���


"�


zGitConfigParser.writer@cCs|jrtd||f��dS)Nz(Cannot execute non-constant method %s.%s)r�r�)rLr@r4r4r5r$
s�z GitConfigParser._assure_writablerc�cp._SectionNamecs|�|d�t��|�S)z)Assures added options will stay in order.rc)�_assure_config_name_safer;r�)rLrcrCr4r5r�szGitConfigParser.add_sectioncCrr)zD:return: ``True`` if this instance may change the configuration file)r�rgr4r4r5r�rszGitConfigParser.read_onlyr�r�cCs<z|�||�}Wnty|dur|YS�w|�|�S)aGet an option's value.

        If multiple values are specified for this option in the section, the last one
        specified is returned.

        :param default:
            If not ``None``, the given default value will be returned in case the option
            did not exist.

        :return:
            A properly typed value, either int, float or string

        :raise TypeError:
            In case the value could not be understood.
            Otherwise the exceptions known to the ConfigParser will be raised.
        N)r]�	Exception�_string_to_value)rLrcr�r��valuestrr4r4r5r[s�
zGitConfigParser.get_valuecsRz����j|�|�}Wnty|dur|gYS�w�fdd�|D�S)aGet an option's values.

        If multiple values are specified for this option in the section, all are
        returned.

        :param default:
            If not ``None``, a list containing the given default value will be returned
            in case the option did not exist.

        :return:
            A list of properly typed values, either int, float or string

        :raise TypeError:
            In case the value could not be understood.
            Otherwise the exceptions known to the ConfigParser will be raised.
        Ncsg|]}��|��qSr4)r*)r2r+rgr4r5r�Vsz.GitConfigParser.get_values.<locals>.<listcomp>)r�r�r�r))rLrcr�r��lstr4rgr5�
get_values8s
�zGitConfigParser.get_valuesr+c
Cs�ttf}|D]}z||�}|t|�krWq|WSttfy$Yqw|��}|dkr/dS|dkr5dSt|t�s?td|��|S)N�falseF�trueTz=Invalid value type: only int, long, float and str are allowed)�int�floatr�rr�r�rI)rLr+�typesZnumtype�valZvlr4r4r5r*Xs*
�
�z GitConfigParser._string_to_valuer�cCs t|tttf�rt|�St|�SrO)r�r0r1�boolrIrrr4r4r5rtsz GitConfigParser._value_to_stringcCs |�|�}t�|�rtd��|S)Nz1Git config values must not contain CR, LF, or NUL)r�UNSAFE_CONFIG_CHARS_RErr�)rLr��	value_strr4r4r5�_value_to_string_safeys

z%GitConfigParser._value_to_string_safer*�labelcCs(t|t�rt�|�rtd|��dSdS)Nz3Git config %s names must not contain CR, LF, or NUL)r�rIr5rr�)rLr*r8r4r4r5r(s�z(GitConfigParser._assure_config_name_safecs:|�|d�|�|d�|dur|�|�}t��|||�S)Nrcr�)r(r7r;r^)rLrcr�r�rCr4r5r^�s

zGitConfigParser.setcsJ|�|d�|�|d�|�|�}|�|�s|�|�t��|||�|S)aSet the given option in section to the given value.

        This will create the section if required, and will not throw as opposed to the
        default ConfigParser ``set`` method.

        :param section:
            Name of the section in which the option resides or should reside.

        :param option:
            Name of the options whose value to set.

        :param value:
            Value to set the option to. It must be a string or convertible to a string.

        :return:
            This instance
        rcr�)r(r7�has_sectionr�r;r^�rLrcr�r�r6rCr4r5r\�s


zGitConfigParser.set_valuecCsL|�|d�|�|d�|�|�}|�|�s|�|�|j|�||�|S)a�Add a value for the given option in section.

        This will create the section if required, and will not throw as opposed to the
        default ConfigParser ``set`` method. The value becomes the new value of the
        option as returned by :meth:`get_value`, and appends to the list of values
        returned by :meth:`get_values`.

        :param section:
            Name of the section in which the option resides or should reside.

        :param option:
            Name of the option.

        :param value:
            Value to add to option. It must be a string or convertible to a string.

        :return:
            This instance
        rcr�)r(r7r9r�r�r�r:r4r4r5�	add_value�s


zGitConfigParser.add_value�new_namecs||�|�std|��|�|d�|�|�rtd|��t��|�|j|}|�|�D]
\}}|�||�q,|�|�|S)z�Rename the given section to `new_name`.

        :raise ValueError:
            If:

            * `section` doesn't exist.
            * A section with `new_name` does already exist.

        :return:
            This instance
        z!Source section '%s' doesn't existrcz'Destination section '%s' already exists)	r9r�r(r;r�r�r�r�r_)rLrcr<Znew_sectionr�r!rCr4r5�rename_section�s



zGitConfigParser.rename_section)NTTNNr{)r-r)rcr'r-NrO);rErFrGrHr	r�r�compiler�Zoptvalueonly_sourcer�r�r.rrrr4rrdr�rhrur
ryrfrIr�rr
rr�r0r�rrr�rPrr�r�r9rUr$r�r}r�r1r[r-r*rr7r(r:r^r\r;r=rJr4r4rCr5rs�

����
��
�
?


"h
@I""-	����
�#����
�   �����0,")�	metaclass)JrH�__all__�abcZconfigparserr�r�	functoolsrr7�iorr�loggingr�Zos.path�pathr�rr�Z
git.compatrrZgit.utilr	�typingr
rrr
rrrrrrrrZ	git.typesrrrrrrZ
git.repo.baserrrIrr0r1r4r�version_info�collectionsr#ZOrderedDict_OMD�	getLoggerrEr�r(�__annotations__r>rr5�ABCMetar)r9r:rr~r�r�rr4r4r4r5�<module>sR8


""
@-