%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /usr/lib/python2.7/site-packages/salt/modules/
Upload File :
Create Path :
Current File : //usr/lib/python2.7/site-packages/salt/modules/git.pyo

�
���^c@@s dZddlmZmZmZddlZddlZddlZddlZddl	Z	ddl
Z
ddlZddl
ZddlZddlZddlZddlZddlZddlZddlZddlZddlmZmZddlmZddlmZeje�Z idd6Z!d	�Z"e#d
�Z$e%e%e%e%e&e%d�Z'd�Z(d
�Z)d�Z*d�Z+d�Z,e%e%e%e%e&e#e&de%d�	Z-e%e%e%d�Z.e%d�Z/e%d�Z0dde%e%e&e%d�Z1de%de%e%e&e%d�Z2e%dde%e%e&e%d�Z3e%e&dde%e%e&e%d�Z4e%e%dde%e%e%e%e%e&de%d�Z5dde%e%e%e&e%d�Z6e%e%e%e&e%d�Z7e%e%e%e%e&e%d�Z8ej9j:j;e8d �Z<e%e%e%e%e%e&e%d!�Z=e%e%e%e%e&e%d"�Z>e%e%e&e%d#�Z?de%e%e&e%d$�Z@e%e%dde%e%e&e&e%e%d%�
ZAd&e%e%e&e%d'�ZBe%e&e%dde%e%e%e&de%d(�ZCe&e%e%e%dde%e%e&e%d)�
ZDe%e%e%d*�ZEe&e%e%e&e%d+�ZFe%e%e&e%d,�ZGe&e%e%e%d-�ZHe%d.e%dde%e%e%e%e%e&e%dd/�
ZIe%dde%e%e%e&e%d0�ZJe%e&e&e&e%dde%e%e&e%d1�ZKe%e%e%e&e%d2�ZLdde%e%e%e&de%d3�ZMe%e%dde%e%e%e&de%d4�
ZNd5dde%e%e&e%d6�ZOd.e%e%e#e&e%d7�ZPe&e&e%e%e%e%e%e&e%dd8�
ZQd.e%e%e%e%e%e%e%e&e%d9�
ZRe%e%e#e&e%d:�ZSdde%e%e%e&e%d;�ZTe%dde%e%e&e%d<�ZUde&e%e%e&e%d=�ZVdde%e%e&e%d>�ZWd?dde%e%e&e%d@�ZXe%e%e&e%dA�ZYdde%e%e%e&de%dB�ZZe%dde%e%e&e%dC�Z[de%dde%e%e&e%dD�Z\e&dE�Z]e%e%e%e&dde%e%e&e%dF�
Z^e&e#e%dde%e%e&e%dG�	Z_e%e%dH�Z`dS(Iu
Support for the Git SCM
i(tabsolute_importtprint_functiontunicode_literalsN(tSaltInvocationErrortCommandExecutionError(tLooseVersion(tsixurmurm_cC@s-tjjjd�dkr%tdfStSdS(u/
    Only load if git exists on the system
    ugitu;The git execution module cannot be loaded: git unavailable.N(tsalttutilstpathtwhichtNonetFalsetTrue(((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt__virtual__%scC@sLtdt�}t|�td�krH|rDtd|d��ntStS(uJ
    Ensure that we don't try to operate on worktrees in git < 2.5.0.
    tversioninfou2.5.0uKWorktrees are only supported in git 2.5.0 and newer (detected git version: u)(tversionRt
_LooseVersionRR
(tfailhardtgit_version((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt_check_worktree_support0scK@sNtjjj|�}|jdt�}	|rCtjjj|�n|dkrg|	svtd��qvnt	||�}|dkr�|dk	r�t
|tj�r�tj
|�}q�nd}ddg}
|
jt|	|||d|��|
j|�|
j|�|dk	r |
j|�nt|
d|d|d	|d
|dtd|�S(
u�
    Common code for config.get_* functions, builds and runs the git CLI command
    and returns the result dict for the calling function to parse.
    uglobalu*'cwd' argument required unless global=Trueu--get-regexpugituconfigtoutput_encodingtcwdtusertpasswordtignore_retcodeRN(RRtargstclean_kwargstpopRtinvalid_kwargsRRt_expand_patht
isinstanceRtstring_typest	text_typetextendt_which_git_configtappendt_git_run(tget_opttkeytvalue_regexRRRRRtkwargstglobal_tcommand((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt_config_getter?s8



	cC@s�y|rd|nd}Wn0tk
rL|rCdtj|�nd}nXy#tjjtjj|�|�SWn6tk
r�tjjtjj|�tj|��SXdS(u
    Expand home directory
    u~N(t	TypeErrorRR!tosR	tjoint
expandusertAttributeError(RRt	to_expand((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyRqs
##
cC@swd}xj|rr||krry!tj|�jtj@s;tSWntk
rPtSX|}tjj|�\}}q	Wt	S(u<
    Check every part of path for executable permission
    N(
RR.tstattst_modetS_IXOTHRtOSErrorR	tsplitR
(R	tprevpatht_((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt_path_is_executable_others�s
cC@s�|dkrgSt|t�rrg}xF|D]>}t|tj�rT|j|�q,|jtj|��q,W|St|tj�s�tj|�g}ntjj	j
|�}tjjj|�}y|ddkr�|d SWnt
k
r�nX|S(uA
    Common code to inspect opts and split them if necessary
    i����u--N(RRtlistRR R$R!RRRtshlex_splittdatatdecodet
IndexError(toptstnew_optstitem((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt_format_opts�s&

cC@sR|rHtdt�}t|�td�krHtdj|���qHnt|�S(uc
    Do a version check and make sure that the installed version of git can
    support git -c
    Ru1.7.2uDgit_opts is only supported for git versions >= 1.7.2 (detected: {0})(RRRRtformatRC(R@tversion_((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt_format_git_opts�scC@s�tjjtjd�tjddddd�tjjtjd�tjdddd�g}xM|D]?}tj|�}|rdtjj|d�rd|d}PqdqdWd}|S(	uK
    Windows only: search for Git's bundled ssh.exe in known locations
    uSystemDriveuProgram Files*uGituusrubinussh.exeiN(R.R	R/tgetenvtseptglobtisfileR(t	globmaskstglobmasktssh_exetret((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt
_find_ssh_exe�s	

ubasec
K@si}|rytjdd�}g}
g}t|t�sE|g}nd}x�|D]�}d|krtjjjd��3tjjj	�}|}t
d|||�}WdQX|s�tjd|�t
d|�qRq4|r4t
j|t
d	|�d
�q4n3t
d|�s4|j|�tjd|�qRni|d6}t
jjt
jjtjjjd
��}d}tjjj�r�t�}|dkr�td��n||d<|d7}||d<n|s�t|�r�||d<n_tjjj	�}tjjj||�t
j|d�t
j|t
d	|�d
�||d<d|krtd|�r|
jdj|��qRntjd|�zVt
d|d|d|d|d|dtdtjj j!d|d|d |	|
�	}Wd|rRy"t
d|�tj"d!|�WqRt#k
r#qRt$tfk
rN}tj%d"||�qRXn|r�y"t
d|�tj"d#|�Wq�t#k
r�q�t$tfk
r�}tj%d$||�q�XnX|d%d&kr�|S||r�d'nd(}|rR|
jtjj j!|��qRqRW|rud)jd*j|
��}|rf|
rG|d+7}n|d,jd-j|��7}nt|��n|St
d|d|d|d|d|dtdtjj j!d|d|d |	|
�	}|d%d&kr�|S|rwt|t�rd.j|�n|}d/jtjj j!|��}||r6d'nd(}|rh|d0jtjj j!|��7}nt|��n|SdS(1u-
    simple, throw an exception with the error message on an error return code.

    this function may be moved to the command module, spliced with
    'cmd.run_all', and used as an alternative to 'cmd.run_all'. Some
    commands don't return proper retcodes, so this can't replace 'cmd.run_all'.
    u__cliuusalt://i?ucp.get_fileNuidentity %s does not exist.ufile.removeufile.user_to_uidi����ufile.file_existsuGIT_IDENTITYugit/ssh-id-wrapperu3Failed to find ssh.exe, unable to use identity fileuGIT_SSH_EXEu.batuGIT_SSHi@u	salt-callussh.key_is_encryptedu�Identity file {0} is passphrase-protected and cannot be used in a non-interactive command. Using salt-call from the minion will allow a passphrase-protected key to be used.u4Attempting git authentication using identity file %sucmd.run_allRtrunasRtenvtpython_shelltlog_callbackRtredirect_stderrRuRemoved ssh wrapper file %su(Failed to remove ssh wrapper file %s: %suRemoved identity file %su%Failed to remove identity file %s: %suretcodeiustdoutustderru0Unable to authenticate using identity file:

{0}u
u

u2The following identity file(s) were not found: {0}u, u uCommand '{0}' failedu: {0}(&t__opts__tgetRR;RRRtfilest	set_umasktmkstempt__salt__tlogterrorR.tchownR$R	tabspathR/t	templatestTEMPLATE_DIRNAMEtplatformt
is_windowsRORR:tcopyfiletchmodt	__utils__RDtinfoRturltredact_http_basic_authtdebugR1Rtwarning(R+RRRtidentityRRRTtsaltenvRR)RQt	_salt_cliterrorstmissing_keysttmp_identity_filetid_filet_id_filetssh_id_wrapperttmp_ssh_wrapperRMtresulttexcterrtmsgt
gitcommand((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyR%�s


	



	








#
		c
C@s/tdddgd|d|d|d|�dS(	u=
    Use git rev-parse to return the top level of a repo
    ugitu	rev-parseu--show-toplevelRRRRustdout(R%(R	RRR((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt
_get_toplevel�scC@s�d|}|tkr�t|ddgd|d|dtd|�}tjj|�sg||df}n|df}tjj|�t|<nt|S(	u/
    Helper to retrieve git config options
    ugit.config.R@u	--git-dirRRRRuconfig(t__context__t	rev_parseR
R.R	tisabsR/(RRRRt
contextkeytgit_dirtpaths((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt_git_config�s
			cC@s[|r
dgSttdt��}|td�kr;dgSdt|||d|�gSdS(u�
    Based on whether global or local config is desired, return a list of CLI
    args to include in the git config command.
    u--globalRu1.7.10.2u--localu--fileRN(RRRR�(R*RRRRRE((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyR#�suc
C@s�t||�}dgt|�}|jddg�|jgt|�D]}	|	dkrH|	^qH�|jd|g�t|d|d|d|d	|d
|�dS(
u9
    .. versionchanged:: 2015.8.0
        The ``--verbose`` command line argument is now implied

    Interface to `git-add(1)`_

    cwd
        The path to the git checkout

    filename
        The location of the file/directory to add, relative to ``cwd``

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` (as in the CLI examples
            below) to avoid causing errors with Salt's own argument parsing.

    git_opts
        Any additional options to add to git command itself (not the ``add``
        subcommand), in a single string. This is useful for passing ``-c`` to
        run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-add(1)`: http://git-scm.com/docs/git-add

    CLI Examples:

    .. code-block:: bash

        salt myminion git.add /path/to/repo foo/bar.py
        salt myminion git.add /path/to/repo foo/bar.py opts='--dry-run'
    ugituaddu	--verboseu-vu--RRRRRustdout(u-vu	--verbose(RRFR"RCR%(
RtfilenameR@tgit_optsRRRRR+tx((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytadd�sK,	uHEADc	K@s#t||�}t||�}tjjj|	�}	|	jdd
�}
|	ratjjj|	�ndgt|�}|j	d�|dkr�|s�t
jj|�t
j
}n|jd|g�n|
r�|jd|
g�n|jd||g�t|d|d	|d
|d|d|�tS(uF
    .. versionchanged:: 2015.8.0
        Returns ``True`` if successful, raises an error if not.

    Interface to `git-archive(1)`_, exports a tarball/zip file of the
    repository

    cwd
        The path to be archived

        .. note::
            ``git archive`` permits a partial archive to be created. Thus, this
            path does not need to be the root of the git repository. Only the
            files within the directory specified by ``cwd`` (and its
            subdirectories) will be in the resulting archive. For example, if
            there is a git checkout at ``/tmp/foo``, then passing
            ``/tmp/foo/bar`` as the ``cwd`` will result in just the files
            underneath ``/tmp/foo/bar`` to be exported as an archive.

    output
        The path of the archive to be created

    overwrite : False
        Unless set to ``True``, Salt will over overwrite an existing archive at
        the path specified by the ``output`` argument.

        .. versionadded:: 2015.8.0

    rev : HEAD
        The revision from which to create the archive

    format
        Manually specify the file format of the resulting archive. This
        argument can be omitted, and ``git archive`` will attempt to guess the
        archive type (and compression) from the filename. ``zip``, ``tar``,
        ``tar.gz``, and ``tgz`` are extensions that are recognized
        automatically, and git can be configured to support other archive types
        with the addition of git configuration keys.

        See the `git-archive(1)`_ manpage explanation of the
        ``--format`` argument (as well as the ``CONFIGURATION`` section of the
        manpage) for further information.

        .. versionadded:: 2015.8.0

    prefix
        Prepend ``<prefix>`` to every filename in the archive. If unspecified,
        the name of the directory at the top level of the repository will be
        used as the prefix (e.g. if ``cwd`` is set to ``/foo/bar/baz``, the
        prefix will be ``baz``, and the resulting archive will contain a
        top-level directory by that name).

        .. note::
            The default behavior if the ``--prefix`` option for ``git archive``
            is not specified is to not prepend a prefix, so Salt's behavior
            differs slightly from ``git archive`` in this respect. Use
            ``prefix=''`` to create an archive with no prefix.

        .. versionchanged:: 2015.8.0
            The behavior of this argument has been changed slightly. As of
            this version, it is necessary to include the trailing slash when
            specifying a prefix, if the prefix is intended to create a
            top-level directory.

    git_opts
        Any additional options to add to git command itself (not the
        ``archive`` subcommand), in a single string. This is useful for passing
        ``-c`` to run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-archive(1)`: http://git-scm.com/docs/git-archive

    CLI Example:

    .. code-block:: bash

        salt myminion git.archive /path/to/repo /path/to/archive.tar
    uformatugituarchiveuu--prefixu--formatu--outputRRRRRN(RRRRRRRRRFR$R.R	tbasenameRHR"R%R
(RtoutputtrevtprefixR�RRRRR)tformat_R+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytarchive"s,x
	c	C@s�t||�}dgt|�}|jd�|jt|��|dk	r^|j|�nt|d|d|d|d|d|�tS(	uc

    Interface to `git-branch(1)`_

    cwd
        The path to the git checkout

    name
        Name of the branch on which to operate. If not specified, the current
        branch will be assumed.

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            To create a branch based on something other than HEAD, pass the
            name of the revision as ``opts``. If the revision is in the format
            ``remotename/branch``, then this will also set the remote tracking
            branch.

            Additionally, on the Salt CLI, if the opts are preceded with a
            dash, it is necessary to precede them with ``opts=`` (as in the CLI
            examples below) to avoid causing errors with Salt's own argument
            parsing.

    git_opts
        Any additional options to add to git command itself (not the ``branch``
        subcommand), in a single string. This is useful for passing ``-c`` to
        run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-branch(1)`: http://git-scm.com/docs/git-branch

    CLI Examples:

    .. code-block:: bash

        # Set remote tracking branch
        salt myminion git.branch /path/to/repo mybranch opts='--set-upstream-to origin/mybranch'
        # Create new branch
        salt myminion git.branch /path/to/repo mybranch upstream/somebranch
        # Delete branch
        salt myminion git.branch /path/to/repo mybranch opts='-d'
        # Rename branch (2015.8.0 and later)
        salt myminion git.branch /path/to/repo newbranch opts='-m oldbranch'
    ugitubranchRRRRRN(RRFR$R"RCRR%R
(	RtnameR@R�RRRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytbranch�sU
	c	@s�t||�}dgt|�}	|	jd�|rE|	jd�nt���|	j��t�fd�dD��}
|dkr�|
s�td��q�n
|	j|�t|	d|d	|d
|d|dt	d
|�dS(uS

    Interface to `git-checkout(1)`_

    cwd
        The path to the git checkout

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` (as in the CLI examples
            below) to avoid causing errors with Salt's own argument parsing.

    git_opts
        Any additional options to add to git command itself (not the
        ``checkout`` subcommand), in a single string. This is useful for
        passing ``-c`` to run git with temporary changes to the git
        configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    rev
        The remote branch or revision to checkout.

        .. versionchanged:: 2015.8.0
            Optional when using ``-b`` or ``-B`` in ``opts``.

    force : False
        Force a checkout even if there might be overwritten changes

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-checkout(1)`: http://git-scm.com/docs/git-checkout

    CLI Examples:

    .. code-block:: bash

        # Checking out local local revisions
        salt myminion git.checkout /path/to/repo somebranch user=jeff
        salt myminion git.checkout /path/to/repo opts='testbranch -- conf/file1 file2'
        salt myminion git.checkout /path/to/repo rev=origin/mybranch opts='--track'
        # Checking out remote revision into new branch
        salt myminion git.checkout /path/to/repo upstream/master opts='-b newbranch'
        # Checking out current revision into new branch (2015.8.0 and later)
        salt myminion git.checkout /path/to/repo opts='-b newbranch'
    ugitucheckoutu--forcec3@s|]}|�kVqdS(N((t.0R�(R@(s4/usr/lib/python2.7/site-packages/salt/modules/git.pys	<genexpr>su-bu-Bu2'rev' argument is required unless -b or -B in optsRRRRRTRustdout(u-bu-BN(
RRFR$RCR"tanyRRR%R
(RR�tforceR@R�RRRRR+tcheckout_branch((R@s4/usr/lib/python2.7/site-packages/salt/modules/git.pytcheckout"s(V


	c
C@s^t||�}|s$td��ny%tjjj|||	dt�}Wn%tk
rp}
t|
j���nXdgt	|�}|j
d�|jt|��|jd|g�|dk	r�|j
|�tjj|�s�tj|�n|}n+|j
|�tjjj�s dnd}t|d|d|d	|d
|d|
d|d
|�tS(u�
    Interface to `git-clone(1)`_

    cwd
        Location of git clone

        .. versionchanged:: 2015.8.0
            If ``name`` is passed, then the clone will be made *within* this
            directory.

    url
        The URL of the repository to be cloned

        .. versionchanged:: 2015.8.0
            Argument renamed from ``repository`` to ``url``

    name
        Optional alternate name for the top-level directory to be created by
        the clone

        .. versionadded:: 2015.8.0

    opts
        Any additional options to add to the command line, in a single string

    git_opts
        Any additional options to add to git command itself (not the ``clone``
        subcommand), in a single string. This is useful for passing ``-c`` to
        run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    identity
        Path to a private key to use for ssh URLs

        .. warning::

            Unless Salt is invoked from the minion using ``salt-call``, the
            key(s) must be passphraseless. For greater security with
            passphraseless private keys, see the `sshd(8)`_ manpage for
            information on securing the keypair from the remote side in the
            ``authorized_keys`` file.

            .. _`sshd(8)`: http://www.man7.org/linux/man-pages/man8/sshd.8.html#AUTHORIZED_KEYS_FILE_FORMAT

        .. versionchanged:: 2015.8.7

            Salt will no longer attempt to use passphrase-protected keys unless
            invoked from the minion using ``salt-call``, to prevent blocking
            waiting for user input.

        Key can also be specified as a SaltStack file server URL, eg. salt://location/identity_file

        .. versionchanged:: 2016.3.0

    https_user
        Set HTTP Basic Auth username. Only accepted for HTTPS URLs.

        .. versionadded:: 20515.5.0

    https_pass
        Set HTTP Basic Auth password. Only accepted for HTTPS URLs.

        .. versionadded:: 2015.5.0

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    saltenv
        The default salt environment to pull sls files from

        .. versionadded:: 2016.3.1

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-clone(1)`: http://git-scm.com/docs/git-clone

    CLI Example:

    .. code-block:: bash

        salt myminion git.clone /path/to/repo_parent_dir git://github.com/saltstack/salt.git
    uMissing 'url' argumentt
https_onlyugitucloneu--u/tmpRRRRkRRlRN(RRRRRgtadd_http_basic_authR
t
ValueErrort__str__RFR$R"RCRR.R	texiststmakedirsRaRbR%(RRgR�R@R�RRRkt
https_usert
https_passRRlRRvR+t	clone_cwd((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytclone�s<z


	
	c	
C@s�t||�}dgt|�}	|	jdd|g�|	jt|��|rg|	jd|g�nt|	d|d|d|d|d	|�d
S(u

    Interface to `git-commit(1)`_

    cwd
        The path to the git checkout

    message
        Commit message

    opts
        Any additional options to add to the command line, in a single string.
        These opts will be added to the end of the git command being run.

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` (as in the CLI examples
            below) to avoid causing errors with Salt's own argument parsing.

            The ``-m`` option should not be passed here, as the commit message
            will be defined by the ``message`` argument.

    git_opts
        Any additional options to add to git command itself (not the ``commit``
        subcommand), in a single string. This is useful for passing ``-c`` to
        run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    filename
        The location of the file/directory to commit, relative to ``cwd``.
        This argument is optional, and can be used to commit a file without
        first staging it.

        .. note::
            This argument only works on files which are already tracked by the
            git repository.

        .. versionadded:: 2015.8.0

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-commit(1)`: http://git-scm.com/docs/git-commit

    CLI Examples:

    .. code-block:: bash

        salt myminion git.commit /path/to/repo 'The commit message'
        salt myminion git.commit /path/to/repo 'The commit message' filename=foo/bar.py
    ugitucommitu-mu--RRRRRustdout(RRFR"RCR%(
RtmessageR@R�RRR�RRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytcommit5sX	c
K@s�|jdt�}td|d|d|d|d|d||�}|dd	krVd
S|d
j�}	|rp|	Sy|	dSWntk
r�dSXd
S(uq
    Get the value of a key in the git configuration file

    key
        The name of the configuration key to get

        .. versionchanged:: 2015.8.0
            Argument renamed from ``setting_name`` to ``key``

    cwd
        The path to the git checkout

        .. versionchanged:: 2015.8.0
            Now optional if ``global`` is set to ``True``

    global : False
        If ``True``, query the global git configuration. Otherwise, only the
        local git configuration will be queried.

        .. versionadded:: 2015.8.0

    all : False
        If ``True``, return a list of all values set for ``key``. If the key
        does not exist, ``None`` will be returned.

        .. versionadded:: 2015.8.0

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Examples:

    .. code-block:: bash

        salt myminion git.config_get user.name cwd=/path/to/repo
        salt myminion git.config_get user.email global=True
        salt myminion git.config_get core.gitproxy cwd=/path/to/repo all=True
    uallu	--get-allRRRRRuretcodeiustdouti����uN(RRR,Rt
splitlinesR?(
R'RRRRRR)tall_RuRN((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt
config_get�s$I	
c
K@s�td|d|d|d|d|d|d||�}i}	|dd	krP|	Sxd|d
j�D]R}
y|
jdd	�\}}Wntk
r�qanX|	j|g�j|�qaW|	S(uK	
    .. versionadded:: 2015.8.0

    Get the value of a key or keys in the git configuration file using regexes
    for more flexible matching. The return data is a dictionary mapping keys to
    lists of values matching the ``value_regex``. If no values match, an empty
    dictionary will be returned.

    key
        Regex on which key names will be matched

    value_regex
        If specified, return all values matching this regex. The return data
        will be a dictionary mapping keys to lists of values matching the
        regex.

        .. important::
            Only values matching the ``value_regex`` will be part of the return
            data. So, if ``key`` matches a multivar, then it is possible that
            not all of the values will be returned. To get all values set for a
            multivar, simply omit the ``value_regex`` argument.

    cwd
        The path to the git checkout

    global : False
        If ``True``, query the global git configuration. Otherwise, only the
        local git configuration will be queried.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Examples:

    .. code-block:: bash

        # Matches any values for key 'foo.bar'
        salt myminion git.config_get_regexp /path/to/repo foo.bar
        # Matches any value starting with 'baz' set for key 'foo.bar'
        salt myminion git.config_get_regexp /path/to/repo foo.bar 'baz.*'
        # Matches any key starting with 'user.'
        salt myminion git.config_get_regexp '^user\.' global=True
    u--get-regexpR(RRRRRuretcodeiustdoutN(R,R�R7RR�t
setdefaultR$(
R'R(RRRRRR)RuRNtlinetparamtvalue((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytconfig_get_regexp�s&J	
uconfig_get_regexcK@s�tjjj|�}|jdt�}	|jdt�}
|rUtjjj|�n|dkry|
s�td��q�nt	||�}t
d�||fD��r�td��n|dk	rwt|t�sy|j
d�}Wqttk
rtj|�j
d�}qtXqwg}xUtjjj|�D]>}t|tj�rT|j|�q,|jtj|��q,W|}nddg}
|
r�|
jd	�n|dk	rtj|
�}|	r�|jd
�n
|jd�|j||g�t|d|d
|d|d|d|�n�x�t|�D]\}}tj|
�}|dkrY|jd�n
|jd
�|j||g�t|d|d
|d|d|d|�q"Wt|d
|d|d|d|d|itd6|
d6�S(u�
    .. versionchanged:: 2015.8.0
        Return the value(s) of the key being set

    Set a key in the git configuration file

    cwd
        The path to the git checkout. Must be an absolute path, or the word
        ``global`` to indicate that a global key should be set.

        .. versionchanged:: 2014.7.0
            Made ``cwd`` argument optional if ``is_global=True``

    key
        The name of the configuration key to set

        .. versionchanged:: 2015.8.0
            Argument renamed from ``setting_name`` to ``key``

    value
        The value to set for the specified key. Incompatible with the
        ``multivar`` argument.

        .. versionchanged:: 2015.8.0
            Argument renamed from ``setting_value`` to ``value``

    add : False
        Add a value to a key, creating/updating a multivar

        .. versionadded:: 2015.8.0

    multivar
        Set a multivar all at once. Values can be comma-separated or passed as
        a Python list. Incompatible with the ``value`` argument.

        .. versionadded:: 2015.8.0

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    global : False
        If ``True``, set a global variable

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Examples:

    .. code-block:: bash

        salt myminion git.config_set user.email me@example.com cwd=/path/to/repo
        salt myminion git.config_set user.email foo@bar.com global=True
    uadduglobalu*'cwd' argument required unless global=Truecs@s|]}|dk	VqdS(N(R(R�R�((s4/usr/lib/python2.7/site-packages/salt/modules/git.pys	<genexpr>�su/Only one of 'value' and 'multivar' is permittedu,ugituconfigu--globalu--addu
--replace-allRRRRRiuallN(RRRRRRRRRRtallRR;R7R1RR!R=R>R R$tcopyR"R%t	enumerateR�R
(R'R�tmultivarRRRRRR)tadd_R*tnew_multivarRBtcommand_prefixR+tidxttarget((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt
config_setcsvT
	
	

		cK@s]tjjj|�}|jdt�}|jdt�}	|rUtjjj|�n|dkry|	s�td��q�nt	||�}ddg}
|r�|
j
d�n
|
j
d�|
jt|	|||d|��|
j
|�|dk	r|
j
|�nt
|
d	|dkr|ndd
|d|d|d
td|�}|d}|dkr^tS|dkrytd��n�|dkrt||d
|d|d|d|�dkr�tdj|���qYdj|�}
|dk	r�|
d7}
nt|
��nX|dkrtd��n=dj||�}
|drM|
d|d7}
nt|
��dS(u
    .. versionadded:: 2015.8.0

    Unset a key in the git configuration file

    cwd
        The path to the git checkout. Must be an absolute path, or the word
        ``global`` to indicate that a global key should be unset.

    key
        The name of the configuration key to unset

    value_regex
        Regular expression that matches exactly one key, used to delete a
        single value from a multivar. Ignored if ``all`` is set to ``True``.

    all : False
        If ``True`` unset all values for a multivar. If ``False``, and ``key``
        is a multivar, an error will be raised.

    global : False
        If ``True``, unset set a global variable. Otherwise, a local variable
        will be unset.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Example:

    .. code-block:: bash

        salt myminion git.config_unset /path/to/repo foo.bar
        salt myminion git.config_unset /path/to/repo foo.bar all=True
    ualluglobalu*'cwd' argument required unless global=Trueugituconfigu--unset-allu--unsetRRRRRRuretcodeiiuSection or key is invalidiuKey '{0}' does not existu#Multiple values exist for key '{0}'u( and value_regex matches multiple valuesiuThe value_regex is invalidu<Failed to unset key '{0}', git config returned exit code {1}ustderru; N(RRRRRRRRRRR$R"R#R%R
RR�RD(R'R(RRRRRR)R�R*R+RNtretcodeRx((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytconfig_unsetsfA


		


cC@sMt||�}ddddg}t|d|d|d|d|d	|�d
S(u�
    Returns the current branch name of a local checkout. If HEAD is detached,
    return the SHA1 of the revision which is currently checked out.

    cwd
        The path to the git checkout

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Example:

    .. code-block:: bash

        salt myminion git.current_branch /path/to/repo
    ugitu	rev-parseu--abbrev-refuHEADRRRRRustdout(RR%(RRRRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytcurrent_branch�s.	cC@s�t||�}ddg}ttdt��td�krL|jd�n|j|�t|d|d|d|d	|d
|�dS(uN
    Returns the `git-describe(1)`_ string (or the SHA1 hash if there are no
    tags) for the given revision.

    cwd
        The path to the git checkout

    rev : HEAD
        The revision to describe

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-describe(1)`: http://git-scm.com/docs/git-describe

    CLI Examples:

    .. code-block:: bash

        salt myminion git.describe /path/to/repo
        salt myminion git.describe /path/to/repo develop
    ugitudescribeRu1.5.6u--alwaysRRRRRustdout(RRRRR$R%(RR�RRRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytdescribe�s5!
	cC@s-|r|rtd��ndgt|�}|jd�|jt|��|	dk	r�t|	ttf�r�y|	j	d�}	Wq�t
k
r�tj|	�j	d�}	q�Xnt
}t}
|rPttdt
��td�kr�td��nt}t
}
|jd�x�g||fD]}|r|^qD]}tjd	|�q3Wn�|r�|jd
�|ry|j|�n|r�tjd|�q�n=x:g||fD]}|r�|^q�D]}|j|�q�W|	r�|jd�|j|	�nt|d
|d|d|d|d|
dtd|
�dS(u�
    .. versionadded:: 2015.8.12,2016.3.3,2016.11.0

    Interface to `git-diff(1)`_

    cwd
        The path to the git checkout

    item1 and item2
        Revision(s) to pass to the ``git diff`` command. One or both of these
        arguments may be ignored if some of the options below are set to
        ``True``. When ``cached`` is ``False``, and no revisions are passed
        to this function, then the current working tree will be compared
        against the index (i.e. unstaged changes). When two revisions are
        passed, they will be compared to each other.

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` (as in the CLI examples
            below) to avoid causing errors with Salt's own argument parsing.

    git_opts
        Any additional options to add to git command itself (not the ``diff``
        subcommand), in a single string. This is useful for passing ``-c`` to
        run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    no_index : False
        When it is necessary to diff two files in the same repo against each
        other, and not diff two different revisions, set this option to
        ``True``. If this is left ``False`` in these instances, then a normal
        ``git diff`` will be performed against the index (i.e. unstaged
        changes), and files in the ``paths`` option will be used to narrow down
        the diff output.

        .. note::
            Requires Git 1.5.1 or newer. Additionally, when set to ``True``,
            ``item1`` and ``item2`` will be ignored.

    cached : False
        If ``True``, compare staged changes to ``item1`` (if specified),
        otherwise compare them to the most recent commit.

        .. note::
            ``item2`` is ignored if this option is is set to ``True``.

    paths
        File paths to pass to the ``git diff`` command. Can be passed as a
        comma-separated list or a Python list.

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-diff(1)`: http://git-scm.com/docs/git-diff

    CLI Example:

    .. code-block:: bash

        # Perform diff against the index (staging area for next commit)
        salt myminion git.diff /path/to/repo
        # Compare staged changes to the most recent commit
        salt myminion git.diff /path/to/repo cached=True
        # Compare staged changes to a specific revision
        salt myminion git.diff /path/to/repo mybranch cached=True
        # Perform diff against the most recent commit (includes staged changes)
        salt myminion git.diff /path/to/repo HEAD
        # Diff two commits
        salt myminion git.diff /path/to/repo abcdef1 aabbccd
        # Diff two commits, only showing differences in the specified paths
        salt myminion git.diff /path/to/repo abcdef1 aabbccd paths=path/to/file1,path/to/file2
        # Diff two files with one being outside the working tree
        salt myminion git.diff /path/to/repo no_index=True paths=path/to/file1,/absolute/path/to/file2
    u;The 'no_index' and 'cached' options cannot be used togetherugitudiffu,Ru1.5.1u>The 'no_index' option is only supported in Git 1.5.1 and neweru
--no-indexuQRevision '%s' ignored in git diff, as revisions cannot be used when no_index=Trueu--cachedu]Second revision '%s' ignored in git diff, at most one revision is considered when cached=Trueu--RRRRRRTRustdoutN(RRFR$R"RCRRR;ttupleR7R1RR!RR
RRR[RjR%(Rtitem1titem2R@R�RRtno_indextcachedR�RR+RRR�R�((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytdiff�sZo
"
!
,

,
	u.cC@sSt||�}ddd|g}t|d|d|d|d|dtd	|�d
S(u�
    .. versionadded:: 2019.2.0

    Runs a ``git checkout -- <path>`` from the directory specified by ``cwd``.

    cwd
        The path to the git checkout

    path
        path relative to cwd (defaults to ``.``)

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

    CLI Example:

    .. code-block:: bash

        salt myminion git.discard_local_changes /path/to/repo
        salt myminion git.discard_local_changes /path/to/repo path=foo
    ugitucheckoutu--RRRRRTRustdout(RR%R
(RR	RRRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytdiscard_local_changes�s.	cC@sYt||�}dgt|�}|jd�|rE|jd�n|jgt|�D]}
|
dkrX|
^qX�|r�|j|�n|dk	rt|ttf�s�y|j	d�}Wq�t
k
r�tj|�j	d�}q�Xnt
jjj|�}|j|�nt|d|d|d|d	|d
|	dtd|
d
|�d}tjd�}i}x�t
jjj	|d�D]�}|j|�}|r�|j�\}}}}|j�}|dk	r|dkr�dnd}|j|g�j|�qQ|dk	r5i|d6|d6|jdi�|<qQ|jdg�j|�q�q�W|S(u�

    .. versionchanged:: 2015.8.2
        Return data is now a dictionary containing information on branches and
        tags that were added/updated

    Interface to `git-fetch(1)`_

    cwd
        The path to the git checkout

    remote
        Optional remote name to fetch. If not passed, then git will use its
        default behavior (as detailed in `git-fetch(1)`_).

        .. versionadded:: 2015.8.0

    force
        Force the fetch even when it is not a fast-forward.

        .. versionadded:: 2015.8.0

    refspecs
        Override the refspec(s) configured for the remote with this argument.
        Multiple refspecs can be passed, comma-separated.

        .. versionadded:: 2015.8.0

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` (as in the CLI examples
            below) to avoid causing errors with Salt's own argument parsing.

    git_opts
        Any additional options to add to git command itself (not the ``fetch``
        subcommand), in a single string. This is useful for passing ``-c`` to
        run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    identity
        Path to a private key to use for ssh URLs

        .. warning::

            Unless Salt is invoked from the minion using ``salt-call``, the
            key(s) must be passphraseless. For greater security with
            passphraseless private keys, see the `sshd(8)`_ manpage for
            information on securing the keypair from the remote side in the
            ``authorized_keys`` file.

            .. _`sshd(8)`: http://www.man7.org/linux/man-pages/man8/sshd.8.html#AUTHORIZED_KEYS_FILE_FORMAT

        .. versionchanged:: 2015.8.7

            Salt will no longer attempt to use passphrase-protected keys unless
            invoked from the minion using ``salt-call``, to prevent blocking
            waiting for user input.

        Key can also be specified as a SaltStack file server URL, eg. salt://location/identity_file

        .. versionchanged:: 2016.3.0

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    saltenv
        The default salt environment to pull sls files from

        .. versionadded:: 2016.3.1

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-fetch(1)`: http://git-scm.com/docs/git-fetch

    CLI Example:

    .. code-block:: bash

        salt myminion git.fetch /path/to/repo upstream
        salt myminion git.fetch /path/to/repo identity=/root/.ssh/id_rsa
    ugitufetchu--forceu-fu,RRRRkRRTRlRustdoutuQ[\s*]*(?:([0-9a-f]+)\.\.([0-9a-f]+)|\[(?:new (tag|branch)|tag update)\])\s+(.+)->u
utagunew tagsunew branchesuoldunewuupdated branchesuupdated tags(u-fu--forceN(RRFR$R"RCRRR;R�R7R1RR!RRR=t	stringifyR%R
tretcompilet	itertoolstmatchtgroupstrstripR�(RtremoteR�trefspecsR@R�RRRkRRlRR+R�R�t	update_reRNR�R�told_shatnew_shatnew_ref_typetref_nametref_key((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytfetch�sTz
,
	
	' cC@s\t||�}dgt|�}|jd�|rE|jd�n|d
k	rj|jdj|��n|d
k	r�|jdj|��n|d
k	rt|tj�r�t|t�r�dtj	|�}n*t|tj
�s�tj	|�j�}n|jdj|��n|jt
|��|j|�t|d|d	|d
|	d|
�dS(uX

    Interface to `git-init(1)`_

    cwd
        The path to the directory to be initialized

    bare : False
        If ``True``, init a bare repository

        .. versionadded:: 2015.8.0

    template
        Set this argument to specify an alternate `template directory`_

        .. versionadded:: 2015.8.0

    separate_git_dir
        Set this argument to specify an alternate ``$GIT_DIR``

        .. versionadded:: 2015.8.0

    shared
        Set sharing permissions on git repo. See `git-init(1)`_ for more
        details.

        .. versionadded:: 2015.8.0

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` (as in the CLI examples
            below) to avoid causing errors with Salt's own argument parsing.

    git_opts
        Any additional options to add to git command itself (not the ``init``
        subcommand), in a single string. This is useful for passing ``-c`` to
        run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-init(1)`: http://git-scm.com/docs/git-init
    .. _`template directory`: http://git-scm.com/docs/git-init#_template_directory


    CLI Examples:

    .. code-block:: bash

        salt myminion git.init /path/to/repo
        # Init a bare repo (before 2015.8.0)
        salt myminion git.init /path/to/bare/repo.git opts='--bare'
        # Init a bare repo (2015.8.0 and later)
        salt myminion git.init /path/to/bare/repo.git bare=True
    ugituinitu--bareu--template={0}u--separate-git-dir={0}u0u--shared={0}RRRRustdoutN(RRFR$RRDRRt
integer_typestboolR!R tlowerR"RCR%(Rtbarettemplatetseparate_git_dirtsharedR@R�RRRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytinit�s.b

	c

C@st||�}y"t|d|d|d|�}Wntk
rEtSXtjj|d�}y�tjj	j
|d���}xz|D]r}tjjj|�}y|j
dd�\}}	Wntk
r�tSX|dkr�tjj|	�r�tStSq�WWdQXWntk
rtSXtS(	uW
    .. versionadded:: 2015.8.0

    This function will attempt to determine if ``cwd`` is part of a
    worktree by checking its ``.git`` to see if it is a file containing a
    reference to another gitdir.

    cwd
        path to the worktree to be removed

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Example:

    .. code-block:: bash

        salt myminion git.is_worktree /path/to/repo
    RRRu.gituriugitdir:N(RRzRRR.R	R/RRRWtfopentstringutilst
to_unicodeR7RR�R}R
tIOError(
RRRRttopleveltgitdirtfp_R�tlabelR	((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytis_worktree	s**




cC@skt||�}dddddj|s-dnd�g}t|d|d	|d
|d|d|�d
j�S(u�
    .. versionadded:: 2015.8.0

    Return a list of branches

    cwd
        The path to the git checkout

    remote : False
        If ``True``, list remote branches. Otherwise, local branches will be
        listed.

        .. warning::

            This option will only return remote branches of which the local
            checkout is aware, use :py:func:`git.fetch
            <salt.modules.git.fetch>` to update remotes.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Examples:

    .. code-block:: bash

        salt myminion git.list_branches /path/to/repo
        salt myminion git.list_branches /path/to/repo remote=True
    ugitufor-each-refu--formatu%(refname:short)u	refs/{0}/uheadsuremotesRRRRRustdout(RRDR%R�(RR�RRRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt
list_branchesX	s;	cC@sVt||�}dddddg}t|d|d|d|d	|d
|�dj�S(up
    .. versionadded:: 2015.8.0

    Return a list of tags

    cwd
        The path to the git checkout

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Examples:

    .. code-block:: bash

        salt myminion git.list_tags /path/to/repo
    ugitufor-each-refu--formatu%(refname:short)u
refs/tags/RRRRRustdout(RR%R�(RRRRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt	list_tags�	s/		c(K@s�tdt�siSt||�}tjjj|�}|jdt�}|retjjj	|�n|r�|r�t
d��nd4d4d4d�}d�}d�}	d5}
i}tt
d
t��}|td�k}
|
r�tddd
dgd|d|d|d|�}|ddkrVd}|drG|dj|d�7}nt
|��nd�}xbtjjj|dj�d�D]>}tg|
D]}|df^q��}x�tjjj|d�D]�}y"|j�jd4d�\}}Wn9tk
r)|dkrd	}d}q*||�q�nX||
krF||�q�n||ritjd||�q�n|||<q�Wg|
D]}||s~|^q~}|r�tjd d!j|�|�q�ntjj|d�}||||�s�q�n|d|kr|	|d�n|j|di�}||d"<|d|d<|d	dk|d<|dr�d4|d	<|||dd|d|d|�}|r�||d#<q�q�|d	jd$dd�|d	<q�W|St|d|d|d|�}y.t|d%d&d'gd|d|d|�}Wn?t
k
rU}d(|}tj|d)tj �t
|��nX|j!d*�r}tjj||�}ntjj|�s�t
d+j|���nd,�}x�tj"|�D]�}tjj||�} tjj| d-�}!tjj| d�}"||!�}#||"�}$tjj#|#�sHtjd.|!�|}#n|#j$d/�rd|#d0 }#ntjj|#�}||||�s�q�n|#|kr�|	|#�n|$j!d1�r|$jd4d�d2}$|$jd$dd�}%t|d3|$d|d|d|�}&t}'nd4}%|$}&t}'|j|#i�}||d"<|%|d	<|&|d<|'|d<|'r�|||&d|d|d|�}|r�||d#<q�q�q�W|S(6ui
    .. versionadded:: 2015.8.0

    Returns information on worktrees

    .. versionchanged:: 2015.8.4
        Version 2.7.0 added the ``list`` subcommand to `git-worktree(1)`_ which
        provides a lot of additional information. The return data has been
        changed to include this information, even for pre-2.7.0 versions of
        git. In addition, if a worktree has a detached head, then any tags
        which point to the worktree's HEAD will be included in the return data.

    .. note::
        By default, only worktrees for which the worktree directory is still
        present are returned, but this can be changed using the ``all`` and
        ``stale`` arguments (described below).

    cwd
        The path to the git checkout

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    all : False
        If ``True``, then return all worktrees tracked under
        $GIT_DIR/worktrees, including ones for which the gitdir is no longer
        present.

    stale : False
        If ``True``, return *only* worktrees whose gitdir is no longer present.

    .. note::
        Only one of ``all`` and ``stale`` can be set to ``True``.

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-worktree(1)`: http://git-scm.com/docs/git-worktree

    CLI Examples:

    .. code-block:: bash

        salt myminion git.list_worktrees /path/to/repo
        salt myminion git.list_worktrees /path/to/repo all=True
        salt myminion git.list_worktrees /path/to/repo stale=True
    Ruallu,'all' and 'stale' cannot both be set to Truec
S@s8tddd|gd|d|d|d|�dj�S(	u.
        Get any tags that point at a
        ugitutagu--points-atRRRRustdout(R%R�(RR�RRR((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt_git_tag_points_at*
s
cS@s)|r|r%|r%tSn
|r%tStS(us
        Common logic to determine whether or not to include the worktree info
        in the return data.
        (RR
(tis_staleR�tstale((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt_desired5
scS@stjd|�dS(u�
        Log errors to the minion log notifying of duplicate worktree paths.
        These should not be there, but may show up due to a bug in git 2.7.0.
        u�git.worktree: Duplicate worktree path %s. This may be caused by a known issue in git 2.7.0 (see http://permalink.gmane.org/gmane.comp.version-control.git/283998)N(R[R\(R	((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt_duplicate_worktree_pathD
suworktreeuHEADubranchRu2.7.0ugitulistu--porcelainRRRRuretcodeiuFailed to list worktreesustderru: {0}cS@stjd|�dS(u'
            Log a warning
            u&git.worktree: Untracked line item '%s'N(R[Rj(R�((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt_untracked_item`
sustdoutu

uu
iudetachedu:git.worktree: Unexpected duplicate %s entry '%s', skippingubgit.worktree: Incomplete worktree data, missing the following information: %s. Full data below:
%su, ustaleutagsurefs/heads/R@u
--git-pathu	worktreesu%Failed to find worktree location for texc_info_on_loglevelu.gitu(Worktree admin directory {0} not presentcS@s�yVtjjj|d��8}x*|D]"}tjjj|�j�}Pq%W|SWdQXWn/ttfk
r�}tjjj	||�nXdS(uY
            Return contents of a single line file with EOF newline stripped
            urN(
RRRWR�R�R�tstripR�R6tprocess_read_exception(R	R�R�RNRv((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt
_read_file�
s
ugitdiru�Non-absolute path found in %s. If git 2.7.0 was installed and then downgraded, this was likely caused by a known issue in git 2.7.0. See http://permalink.gmane.org/gmane.comp.version-control.git/283998 for more information.u/.giti����uref: i����R�N(uworktreeuHEADubranch(%RR
RRRRRRRRRRRRR%RDR�R7R�tdictR�R[R\R/R.R	tisdirR�treplaceRzR|tloggingtDEBUGt
startswithtlistdirR}tendswith((RR�RRRR)R�R�R�R�ttracked_data_pointsRNRthas_native_list_subcommandtoutRxR�tindividual_worktreeR�t
worktree_dataR�ttype_R�tmissingtworktree_is_staletwt_ptrt
tags_foundR�t
worktree_rootRvR�t
worktree_namet	admin_dirtgitdir_filet	head_filetwt_locthead_reft	wt_branchtwt_headtwt_detached((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytlist_worktrees�	sE
			
	&%"
	



#



	!		

		

			



	uoriginc
C@sY|d
k	rt||�}ny%tjjj|||	dt�}Wn%tk
rj}
t|
j	���nXdgt
|�}|jd�|jt
|��|j|�|r�|j|�nt|d|d|d|d|d|
d	|d
|�d}i}xQ|j�D]C}y|jd
d�\}}Wntk
rFqnX|||<qW|S(u�
    Interface to `git-ls-remote(1)`_. Returns the upstream hash for a remote
    reference.

    cwd
        The path to the git checkout. Optional (and ignored if present) when
        ``remote`` is set to a URL instead of a remote name.

    remote : origin
        The name of the remote to query. Can be the name of a git remote
        (which exists in the git checkout defined by the ``cwd`` parameter),
        or the URL of a remote repository.

        .. versionchanged:: 2015.8.0
            Argument renamed from ``repository`` to ``remote``

    ref
        The name of the ref to query. Optional, if not specified, all refs are
        returned. Can be a branch or tag name, or the full name of the
        reference (for example, to get the hash for a Github pull request number
        1234, ``ref`` can be set to ``refs/pull/1234/head``

        .. versionchanged:: 2015.8.0
            Argument renamed from ``branch`` to ``ref``

        .. versionchanged:: 2015.8.4
            Defaults to returning all refs instead of master.

    opts
        Any additional options to add to the command line, in a single string

        .. versionadded:: 2015.8.0

    git_opts
        Any additional options to add to git command itself (not the
        ``ls-remote`` subcommand), in a single string. This is useful for
        passing ``-c`` to run git with temporary changes to the git
        configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    identity
        Path to a private key to use for ssh URLs

        .. warning::

            Unless Salt is invoked from the minion using ``salt-call``, the
            key(s) must be passphraseless. For greater security with
            passphraseless private keys, see the `sshd(8)`_ manpage for
            information on securing the keypair from the remote side in the
            ``authorized_keys`` file.

            .. _`sshd(8)`: http://www.man7.org/linux/man-pages/man8/sshd.8.html#AUTHORIZED_KEYS_FILE_FORMAT

        .. versionchanged:: 2015.8.7

            Salt will no longer attempt to use passphrase-protected keys unless
            invoked from the minion using ``salt-call``, to prevent blocking
            waiting for user input.

        Key can also be specified as a SaltStack file server URL, eg. salt://location/identity_file

        .. versionchanged:: 2016.3.0

    https_user
        Set HTTP Basic Auth username. Only accepted for HTTPS URLs.

        .. versionadded:: 2015.5.0

    https_pass
        Set HTTP Basic Auth password. Only accepted for HTTPS URLs.

        .. versionadded:: 2015.5.0

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    saltenv
        The default salt environment to pull sls files from

        .. versionadded:: 2016.3.1

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-ls-remote(1)`: http://git-scm.com/docs/git-ls-remote

    CLI Example:

    .. code-block:: bash

        salt myminion git.ls_remote /path/to/repo origin master
        salt myminion git.ls_remote remote=https://mydomain.tld/repo.git ref=mytag opts='--tags'
    R�ugitu	ls-remoteRRRRkRRlRustdoutiN(RRRRRgR�R
R�RR�RFR$R"RCR%R�R7R?(RR�trefR@R�RRRkR�R�RRRlRvR+R�RNR�tref_sha1R�((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt	ls_remotes>�


	

c	K@s�tjjj|	�}	|	r1tjjj|	�nt||�}dgt|�}
|
jd�|
jt	|��|r�|
j|�nt
|
d|d|d|d|d|d|�d	S(
u�
    Interface to `git-merge(1)`_

    cwd
        The path to the git checkout

    rev
        Revision to merge into the current branch. If not specified, the remote
        tracking branch will be merged.

        .. versionadded:: 2015.8.0

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` (as in the CLI examples
            below) to avoid causing errors with Salt's own argument parsing.

    git_opts
        Any additional options to add to git command itself (not the ``merge``
        subcommand), in a single string. This is useful for passing ``-c`` to
        run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    identity
        Path to a private key to use for ssh URLs. Salt will not attempt to use
        passphrase-protected keys unless invoked from the minion using
        ``salt-call``, to prevent blocking waiting for user input. Key can also
        be specified as a SaltStack file server URL, eg.
        ``salt://location/identity_file``.

        .. note::
            For greater security with passphraseless private keys, see the
            `sshd(8)`_ manpage for information on securing the keypair from the
            remote side in the ``authorized_keys`` file.

            .. _`sshd(8)`: http://www.man7.org/linux/man-pages/man8/sshd.8.html#AUTHORIZED_KEYS_FILE_FORMAT

        .. versionadded:: 2018.3.5,2019.2.1,Neon

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-merge(1)`: http://git-scm.com/docs/git-merge

    CLI Example:

    .. code-block:: bash

        # Fetch first...
        salt myminion git.fetch /path/to/repo
        # ... then merge the remote tracking branch
        salt myminion git.merge /path/to/repo
        # .. or merge another rev
        salt myminion git.merge /path/to/repo rev=upstream/foo
    ugitumergeRRRRkRRustdout(RRRRRRRFR$R"RCR%(RR�R@R�RRRkRRR)R+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytmerge�s a
	cK@sDt||�}tjjj|�}|jdt�}
|rRtjjj|�n|
ry|sj|sj|rytd��n|d!kr�g}nIt
|ttf�s�gt
j|�jd�D]}|j�^q�}ntg||||fD]}|r�|^q��}|dkr#td��nf|rMt|�dkr�td��q�n<|r�t|�dkrttd��q�|s�d	g}q�n|rttd
t��td�krt|d|d
ddgd|d|	d|
d|�}t|d|dtd|d|	d|
d|�|kSndgt|�}|jd�|jt|��|
rg|jd�n|r}|jd�nH|r�|jd�n2|r�|jd�n|r�|jd|g�n|j|�t|d|d|d|	d|
d|r�tntd|�}|r"|dd
kS|d j�}|
r<|S|d
S("ul
    .. versionadded:: 2015.8.0

    Interface to `git-merge-base(1)`_.

    cwd
        The path to the git checkout

    refs
        Any refs/commits to check for a merge base. Can be passed as a
        comma-separated list or a Python list.

    all : False
        Return a list of all matching merge bases. Not compatible with any of
        the below options except for ``octopus``.

    octopus : False
        If ``True``, then this function will determine the best common
        ancestors of all specified commits, in preparation for an n-way merge.
        See here_ for a description of how these bases are determined.

        Set ``all`` to ``True`` with this option to return all computed merge
        bases, otherwise only the "best" will be returned.

    is_ancestor : False
        If ``True``, then instead of returning the merge base, return a
        boolean telling whether or not the first commit is an ancestor of the
        second commit.

        .. note::
            This option requires two commits to be passed.

        .. versionchanged:: 2015.8.2
            Works properly in git versions older than 1.8.0, where the
            ``--is-ancestor`` CLI option is not present.

    independent : False
        If ``True``, this function will return the IDs of the refs/commits
        passed which cannot be reached by another commit.

    fork_point
        If passed, then this function will return the commit where the
        commit diverged from the ref specified by ``fork_point``. If no fork
        point is found, ``None`` is returned.

        .. note::
            At most one commit is permitted to be passed if a ``fork_point`` is
            specified. If no commits are passed, then ``HEAD`` is assumed.

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` (as in the CLI examples
            below) to avoid causing errors with Salt's own argument parsing.

            This option should not be necessary unless new CLI arguments are
            added to `git-merge-base(1)`_ and are not yet supported in Salt.

    git_opts
        Any additional options to add to git command itself (not the
        ``merge-base`` subcommand), in a single string. This is useful for
        passing ``-c`` to run git with temporary changes to the git
        configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        if ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-merge-base(1)`: http://git-scm.com/docs/git-merge-base
    .. _here: http://git-scm.com/docs/git-merge-base#_discussion

    CLI Examples:

    .. code-block:: bash

        salt myminion git.merge_base /path/to/repo HEAD upstream/mybranch
        salt myminion git.merge_base /path/to/repo 8f2e542,4ad8cab,cdc9886 octopus=True
        salt myminion git.merge_base /path/to/repo refs=8f2e542,4ad8cab,cdc9886 independent=True
        salt myminion git.merge_base /path/to/repo refs=8f2e542,4ad8cab is_ancestor=True
        salt myminion git.merge_base /path/to/repo fork_point=upstream/master
        salt myminion git.merge_base /path/to/repo refs=mybranch fork_point=upstream/master
    ualluWThe 'all' argument is not compatible with 'independent', 'is_ancestor', or 'fork_point'u,iuROnly one of 'octopus', 'independent', 'is_ancestor', and 'fork_point' is permittediu6Two refs/commits are required if 'is_ancestor' is TrueuAAt most one ref/commit can be passed if 'fork_point' is specifieduHEADRu1.8.0R�iR@u--verifyRRRRtrefstis_ancestorugitu
merge-baseu--allu	--octopusu
--is-ancestoru
--independentu--fork-pointRRuretcodeustdoutN(RRRRRRRRRRRR;R�RR!R7R�tlenRRR|t
merge_baseRFR$R"RCR%R
R�(RR
toctopusRtindependentt
fork_pointR@R�RRRRR)R�R�tmutually_exclusive_counttfirst_commitR+Rut	all_bases((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyR
(s�|	4.!	
			

		c	C@s�t||�}ddg}|dkr~y"t|d||gd|�}Wq~ttfk
rztdj||���q~Xn|j|||g�t|d|d|d|d	|d|�d
S(u�
    .. versionadded:: 2015.8.0

    Interface to `git-merge-tree(1)`_, shows the merge results and conflicts
    from a 3-way merge without touching the index.

    cwd
        The path to the git checkout

    ref1
        First ref/commit to compare

    ref2
        Second ref/commit to compare

    base
        The base tree to use for the 3-way-merge. If not provided, then
        :py:func:`git.merge_base <salt.modules.git.merge_base>` will be invoked
        on ``ref1`` and ``ref2`` to determine the merge base to use.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        if ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-merge-tree(1)`: http://git-scm.com/docs/git-merge-tree

    CLI Examples:

    .. code-block:: bash

        salt myminion git.merge_tree /path/to/repo HEAD upstream/dev
        salt myminion git.merge_tree /path/to/repo HEAD upstream/dev base=aaf3c3d
    ugitu
merge-treeR
Ru.Unable to determine merge base for {0} and {1}RRRRustdoutN(RRR
RRRDR"R%(	Rtref1tref2tbaseRRRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt
merge_tree�s"?
	c	
C@szt||�}dgt|�}	|	jd�|	jt|��t|	d|d|d|d|d|d|d	|�d
S(uA
    Interface to `git-pull(1)`_

    cwd
        The path to the git checkout

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` (as in the CLI examples
            below) to avoid causing errors with Salt's own argument parsing.

    git_opts
        Any additional options to add to git command itself (not the ``pull``
        subcommand), in a single string. This is useful for passing ``-c`` to
        run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    identity
        Path to a private key to use for ssh URLs

        .. warning::

            Unless Salt is invoked from the minion using ``salt-call``, the
            key(s) must be passphraseless. For greater security with
            passphraseless private keys, see the `sshd(8)`_ manpage for
            information on securing the keypair from the remote side in the
            ``authorized_keys`` file.

            .. _`sshd(8)`: http://www.man7.org/linux/man-pages/man8/sshd.8.html#AUTHORIZED_KEYS_FILE_FORMAT

        .. versionchanged:: 2015.8.7

            Salt will no longer attempt to use passphrase-protected keys unless
            invoked from the minion using ``salt-call``, to prevent blocking
            waiting for user input.

        Key can also be specified as a SaltStack file server URL, eg. salt://location/identity_file

        .. versionchanged:: 2016.3.0

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    saltenv
        The default salt environment to pull sls files from

        .. versionadded:: 2016.3.1

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-pull(1)`: http://git-scm.com/docs/git-pull

    CLI Example:

    .. code-block:: bash

        salt myminion git.pull /path/to/repo opts='--rebase origin master'
    ugitupullRRRRkRRlRustdout(RRFR$R"RCR%(
RR@R�RRRkRRlRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytpullP
sa
	c
K@s�tjjj|�}|r1tjjj|�nt||�}dgt|�}|jd�|jt	|��|j||g�t
|d|d|d|d|d|d|	d	|
�d
S(u�

    Interface to `git-push(1)`_

    cwd
        The path to the git checkout

    remote
        Name of the remote to which the ref should being pushed

        .. versionadded:: 2015.8.0

    ref : master
        Name of the ref to push

        .. note::
            Being a refspec_, this argument can include a colon to define local
            and remote ref names.

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` (as in the CLI examples
            below) to avoid causing errors with Salt's own argument parsing.

    git_opts
        Any additional options to add to git command itself (not the ``push``
        subcommand), in a single string. This is useful for passing ``-c`` to
        run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    identity
        Path to a private key to use for ssh URLs

        .. warning::

            Unless Salt is invoked from the minion using ``salt-call``, the
            key(s) must be passphraseless. For greater security with
            passphraseless private keys, see the `sshd(8)`_ manpage for
            information on securing the keypair from the remote side in the
            ``authorized_keys`` file.

            .. _`sshd(8)`: http://www.man7.org/linux/man-pages/man8/sshd.8.html#AUTHORIZED_KEYS_FILE_FORMAT

        .. versionchanged:: 2015.8.7

            Salt will no longer attempt to use passphrase-protected keys unless
            invoked from the minion using ``salt-call``, to prevent blocking
            waiting for user input.

        Key can also be specified as a SaltStack file server URL, eg. salt://location/identity_file

        .. versionchanged:: 2016.3.0

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    saltenv
        The default salt environment to pull sls files from

        .. versionadded:: 2016.3.1

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-push(1)`: http://git-scm.com/docs/git-push
    .. _refspec: http://git-scm.com/book/en/v2/Git-Internals-The-Refspec

    CLI Example:

    .. code-block:: bash

        # Push master as origin/master
        salt myminion git.push /path/to/repo origin master
        # Push issue21 as upstream/develop
        salt myminion git.push /path/to/repo upstream issue21:develop
        # Delete remote branch 'upstream/temp'
        salt myminion git.push /path/to/repo upstream :temp
    ugitupushRRRRkRRlRustdout(RRRRRRRFR$R"RCR%(
RR�RR@R�RRRkRRlRR)R+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytpush�
s v
	umasterc	C@s�t||�}t|�}td�|D��r@td��ndgt|�}|jd�|j|�t|tj	�s�tj
|�}n|jtjj
j|��t|d|d|d|d|d	|�d
S(u#
    Interface to `git-rebase(1)`_

    cwd
        The path to the git checkout

    rev : master
        The revision to rebase onto the current branch

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` (as in the CLI examples
            below) to avoid causing errors with Salt's own argument parsing.

    git_opts
        Any additional options to add to git command itself (not the ``rebase``
        subcommand), in a single string. This is useful for passing ``-c`` to
        run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-rebase(1)`: http://git-scm.com/docs/git-rebase


    CLI Example:

    .. code-block:: bash

        salt myminion git.rebase /path/to/repo master
        salt myminion git.rebase /path/to/repo 'origin master'
        salt myminion git.rebase /path/to/repo origin/master opts='--onto newbranch'
    cs@s!|]}|dkr|VqdS(u-iu
--interactiveN(u-iu
--interactive((R�R�((s4/usr/lib/python2.7/site-packages/salt/modules/git.pys	<genexpr>�su%Interactive rebases are not supportedugiturebaseRRRRRustdout(RRCR�RRFR$R"RRR R!RRRR<R%(	RR�R@R�RRRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytrebaseHs J

	cC@sht||�}t|d|d|d|d|d|�}||kr`tdj||���n||S(u�
    Get the fetch and push URL for a specific remote

    cwd
        The path to the git checkout

    remote : origin
        Name of the remote to query

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    redact_auth : True
        Set to ``False`` to include the username/password if the remote uses
        HTTPS Basic Auth. Otherwise, this information will be redacted.

        .. warning::
            Setting this to ``False`` will not only reveal any HTTPS Basic Auth
            that is configured, but the return data will also be written to the
            job cache. When possible, it is recommended to use SSH for
            authentication.

        .. versionadded:: 2015.5.6

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Examples:

    .. code-block:: bash

        salt myminion git.remote_get /path/to/repo
        salt myminion git.remote_get /path/to/repo upstream
    RRtredact_authRRu7Remote '{0}' not present in git checkout located at {1}(RtremotesRRD(RR�RRRRRtall_remotes((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt
remote_get�s?		cK@s�tjjj|�}|jdd�}|rCtjjj|�nddg}
|re|
jd�n|r{|
jd�ny,|
jtjjj	|||dt
��Wn%tk
r�}t|j
���nX|r�|
j|�nt|
d|d|d	|d
|d|
d|	�d
}i}x]tjjj|d�D]C}y|jdd�\}}Wntk
rpq8nX|||<q8W|S(u
    .. versionadded:: 2015.8.0

    Return the remote refs for the specified URL by running ``git ls-remote``.

    url
        URL of the remote repository

    filter
        Optionally provide a ref name to ``git ls-remote``. This can be useful
        to make this function run faster on repositories with many
        branches/tags.

        .. versionadded:: 2019.2.0

    heads : False
        Restrict output to heads. Can be combined with ``tags``.

    tags : False
        Restrict output to tags. Can be combined with ``heads``.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    identity
        Path to a private key to use for ssh URLs

        .. warning::

            Unless Salt is invoked from the minion using ``salt-call``, the
            key(s) must be passphraseless. For greater security with
            passphraseless private keys, see the `sshd(8)`_ manpage for
            information on securing the keypair from the remote side in the
            ``authorized_keys`` file.

            .. _`sshd(8)`: http://www.man7.org/linux/man-pages/man8/sshd.8.html#AUTHORIZED_KEYS_FILE_FORMAT

        .. versionchanged:: 2015.8.7

            Salt will no longer attempt to use passphrase-protected keys unless
            invoked from the minion using ``salt-call``, to prevent blocking
            waiting for user input.

        Key can also be specified as a SaltStack file server URL, eg. salt://location/identity_file

        .. versionchanged:: 2016.3.0

    https_user
        Set HTTP Basic Auth username. Only accepted for HTTPS URLs.

    https_pass
        Set HTTP Basic Auth password. Only accepted for HTTPS URLs.

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

    saltenv
        The default salt environment to pull sls files from

        .. versionadded:: 2016.3.1

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Example:

    .. code-block:: bash

        salt myminion git.remote_refs https://github.com/saltstack/salt.git
        salt myminion git.remote_refs https://github.com/saltstack/salt.git filter=develop
    ufilterugitu	ls-remoteu--headsu--tagsR�RRRkRRlRustdoutu
iN(RRRRRRRR$RgR�R
R�RR�R%R�R7(RgtheadsttagsRRRkR�R�RRRlR)tfilter_R+RvR�RNR�t	sha1_hashR�((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytremote_refs�sBd	

c
C@s�|t|d|d|d|�krttjd||�ddd|g}t|d|d|d|d	|
d|�ny%tjjj|||d
t�}Wn%t	k
r�}
t
|
j���nXddd||g}t|d|d|d|d	|
d|�|r�t|t
j�s(t
j|�}ny%tjjj|||	d
t�}Wn(t	k
rw}
t
t
j|
���nXdddd
||g}t|d|d|d|d	|
d|�ntd|d|d|d|d	|
d|�S(uh
    cwd
        The path to the git checkout

    url
        Remote URL to set

    remote : origin
        Name of the remote to set

    push_url
        If unset, the push URL will be identical to the fetch URL.

        .. versionadded:: 2015.8.0

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    https_user
        Set HTTP Basic Auth username. Only accepted for HTTPS URLs.

        .. versionadded:: 2015.5.0

    https_pass
        Set HTTP Basic Auth password. Only accepted for HTTPS URLs.

        .. versionadded:: 2015.5.0

    push_https_user
        Set HTTP Basic Auth user for ``push_url``. Ignored if ``push_url`` is
        unset. Only accepted for HTTPS URLs.

        .. versionadded:: 2015.8.0

    push_https_pass
        Set HTTP Basic Auth password for ``push_url``. Ignored if ``push_url``
        is unset. Only accepted for HTTPS URLs.

        .. versionadded:: 2015.8.0

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Examples:

    .. code-block:: bash

        salt myminion git.remote_set /path/to/repo git@github.com:user/repo.git
        salt myminion git.remote_set /path/to/repo git@github.com:user/repo.git remote=upstream
        salt myminion git.remote_set /path/to/repo https://github.com/user/repo.git remote=upstream push_url=git@github.com:user/repo.git
    RRRuXRemote '%s' already exists in git checkout located at %s, removing so it can be re-addedugituremoteurmRRR�uadduset-urlu--pushR�(RR[RiR%RRRgR�R
R�RR�RRR R!R(RRgR�RRR�R�tpush_urltpush_https_usertpush_https_passRRR+Rv((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt
remote_setzsbV
	

	
	
cC@sYt||�}dddg}i}t|d|d|d|d|d|�d	}xtjjj|d
�D]�}	y|	jdd�\}
}Wntk
r�qknXy|jdd�\}}
Wntk
r�qknX|
j	d�j
d
�j�}
|
dkrtj
d|
|
|�qkn|r;tjjj|�}n||j|
i�|
<qkW|S(ul
    Get fetch and push URLs for each remote in a git checkout

    cwd
        The path to the git checkout

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    redact_auth : True
        Set to ``False`` to include the username/password for authenticated
        remotes in the return data. Otherwise, this information will be
        redacted.

        .. warning::
            Setting this to ``False`` will not only reveal any HTTPS Basic Auth
            that is configured, but the return data will also be written to the
            job cache. When possible, it is recommended to use SSH for
            authentication.

        .. versionadded:: 2015.5.6

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Example:

    .. code-block:: bash

        salt myminion git.remotes /path/to/repo
    ugituremoteu	--verboseRRRRRustdoutu
iu(u)ufetchupushuAUnknown action '%s' for remote '%s' in git checkout located in %sN(ufetchupush(RR%RRR�R7RR�trsplittlstripR�R�R[RjRgRhR�(RRRRRRR+RNR�tremote_lineR�tremote_infot
remote_urltaction((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyRs8;	



c	C@stt||�}dgt|�}|jd�|jt|��t|d|d|d|d|d|d|�d	S(
u�

    Interface to `git-reset(1)`_, returns the stdout from the git command

    cwd
        The path to the git checkout

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` (as in the CLI examples
            below) to avoid causing errors with Salt's own argument parsing.

    git_opts
        Any additional options to add to git command itself (not the ``reset``
        subcommand), in a single string. This is useful for passing ``-c`` to
        run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    identity
        Path to a private key to use for ssh URLs. Salt will not attempt to use
        passphrase-protected keys unless invoked from the minion using
        ``salt-call``, to prevent blocking waiting for user input. Key can also
        be specified as a SaltStack file server URL, eg.
        ``salt://location/identity_file``.

        .. note::
            For greater security with passphraseless private keys, see the
            `sshd(8)`_ manpage for information on securing the keypair from the
            remote side in the ``authorized_keys`` file.

            .. _`sshd(8)`: http://www.man7.org/linux/man-pages/man8/sshd.8.html#AUTHORIZED_KEYS_FILE_FORMAT

        .. versionadded:: 2018.3.5,2019.2.1,Neon

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-reset(1)`: http://git-scm.com/docs/git-reset

    CLI Examples:

    .. code-block:: bash

        # Soft reset to a specific commit ID
        salt myminion git.reset /path/to/repo ac3ee5c
        # Hard reset
        salt myminion git.reset /path/to/repo opts='--hard origin/master'
    ugituresetRRRRkRRustdout(RRFR$R"RCR%(	RR@R�RRRkRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytreset`sW
	c	C@s�t||�}dgt|�}|jd�|jt|��|d	k	r^|j|�nt|d|d|d|d|d|�dS(
u�

    .. versionadded:: 2015.8.0

    Interface to `git-rev-parse(1)`_

    cwd
        The path to the git checkout

    rev
        Revision to parse. See the `SPECIFYING REVISIONS`_ section of the
        `git-rev-parse(1)`_ manpage for details on how to format this argument.

        This argument is optional when using the options in the `Options for
        Files` section of the `git-rev-parse(1)`_ manpage.

    opts
        Any additional options to add to the command line, in a single string

    git_opts
        Any additional options to add to git command itself (not the
        ``rev-parse`` subcommand), in a single string. This is useful for
        passing ``-c`` to run git with temporary changes to the git
        configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-rev-parse(1)`: http://git-scm.com/docs/git-rev-parse
    .. _`SPECIFYING REVISIONS`: http://git-scm.com/docs/git-rev-parse#_specifying_revisions
    .. _`Options for Files`: http://git-scm.com/docs/git-rev-parse#_options_for_files

    CLI Examples:

    .. code-block:: bash

        # Get the full SHA1 for HEAD
        salt myminion git.rev_parse /path/to/repo HEAD
        # Get the short SHA1 for HEAD
        salt myminion git.rev_parse /path/to/repo HEAD opts='--short'
        # Get the develop branch's upstream tracking branch
        salt myminion git.rev_parse /path/to/repo 'develop@{upstream}' opts='--abbrev-ref'
        # Get the SHA1 for the commit corresponding to tag v1.2.3
        salt myminion git.rev_parse /path/to/repo 'v1.2.3^{commit}'
        # Find out whether or not the repo at /path/to/repo is a bare repository
        salt myminion git.rev_parse /path/to/repo opts='--is-bare-repository'
    ugitu	rev-parseRRRRRustdoutN(RRFR$R"RCRR%(	RR�R@R�RRRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyR|�sR
	cC@sjt||�}ddg}|r1|jd�n|j|�t|d|d|d|d|d|�d	S(
u�
    Returns the SHA1 hash of a given identifier (hash, branch, tag, HEAD, etc.)

    cwd
        The path to the git checkout

    rev : HEAD
        The revision

    short : False
        If ``True``, return an abbreviated SHA1 git hash

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Example:

    .. code-block:: bash

        salt myminion git.revision /path/to/repo mybranch
    ugitu	rev-parseu--shortRRRRRustdout(RR$R%(RR�tshortRRRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytrevision$s5
	c	C@s�t||�}dgt|�}|jd�|jt|��|jd|g�t|d|d|d|d|d|�d	S(
u�
    Interface to `git-rm(1)`_

    cwd
        The path to the git checkout

    filename
        The location of the file/directory to remove, relative to ``cwd``

        .. note::
            To remove a directory, ``-r`` must be part of the ``opts``
            parameter.

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` (as in the CLI examples
            below) to avoid causing errors with Salt's own argument parsing.

    git_opts
        Any additional options to add to git command itself (not the ``rm``
        subcommand), in a single string. This is useful for passing ``-c`` to
        run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-rm(1)`: http://git-scm.com/docs/git-rm

    CLI Examples:

    .. code-block:: bash

        salt myminion git.rm /path/to/repo foo/bar.py
        salt myminion git.rm /path/to/repo foo/bar.py opts='--dry-run'
        salt myminion git.rm /path/to/repo foo/baz opts='-r'
    ugiturmu--RRRRRustdout(RRFR$R"RCR%(	RR�R@R�RRRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytrm_fsM
	usavec	C@stt||�}dgt|�}|jd|g�|jt|��t|d|d|d|d|d|�dS(	u<
    Interface to `git-stash(1)`_, returns the stdout from the git command

    cwd
        The path to the git checkout

    opts
        Any additional options to add to the command line, in a single string.
        Use this to complete the ``git stash`` command by adding the remaining
        arguments (i.e.  ``'save <stash comment>'``, ``'apply stash@{2}'``,
        ``'show'``, etc.).  Omitting this argument will simply run ``git
        stash``.

    git_opts
        Any additional options to add to git command itself (not the ``stash``
        subcommand), in a single string. This is useful for passing ``-c`` to
        run git with temporary changes to the git configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-stash(1)`: http://git-scm.com/docs/git-stash

    CLI Examples:

    .. code-block:: bash

        salt myminion git.stash /path/to/repo save opts='work in progress'
        salt myminion git.stash /path/to/repo apply opts='stash@{1}'
        salt myminion git.stash /path/to/repo drop opts='stash@{1}'
        salt myminion git.stash /path/to/repo list
    ugitustashRRRRRustdout(RRFR"RCR%(	RR-R@R�RRRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytstash�sF	cC@s�t||�}idd6dd6dd6dd6}i}d	d
ddg}t|d
|d|d|d|d|�d}xu|jtd��D]^}	y|	jdd�\}
}Wntk
r�q�nX|j|j|
|
�g�j|�q�W|S(u�
    .. versionchanged:: 2015.8.0
        Return data has changed from a list of lists to a dictionary

    Returns the changes to the repository

    cwd
        The path to the git checkout

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Example:

    .. code-block:: bash

        salt myminion git.status /path/to/repo
    umodifieduMunewuAudeleteduDu	untrackedu??ugitustatusu-zu--porcelainRRRRRustdoutuiN(	RR%R7tstrRR�R�RVR$(RRRRRt	state_mapRNR+R�R�tstateR�((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytstatuss*0
	

)c

K@s�tjjj|
�}
|
jdt�}|
rCtjjj|
�nt||�}|rgtd��ndgt	|�}|j
d|g�|j
t|��t|d|d|d|d|d	|d
|d|	�dS(
u"
    .. versionchanged:: 2015.8.0
        Added the ``command`` argument to allow for operations other than
        ``update`` to be run on submodules, and deprecated the ``init``
        argument. To do a submodule update with ``init=True`` moving forward,
        use ``command=update opts='--init'``

    Interface to `git-submodule(1)`_

    cwd
        The path to the submodule

    command
        Submodule command to run, see `git-submodule(1) <git submodule>` for
        more information. Any additional arguments after the command (such as
        the URL when adding a submodule) must be passed in the ``opts``
        parameter.

        .. versionadded:: 2015.8.0

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` (as in the CLI examples
            below) to avoid causing errors with Salt's own argument parsing.

    git_opts
        Any additional options to add to git command itself (not the
        ``submodule`` subcommand), in a single string. This is useful for
        passing ``-c`` to run git with temporary changes to the git
        configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    init : False
        If ``True``, ensures that new submodules are initialized

        .. deprecated:: 2015.8.0
            Pass ``init`` as the ``command`` parameter, or include ``--init``
            in the ``opts`` param with ``command`` set to update.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    identity
        Path to a private key to use for ssh URLs

        .. warning::

            Unless Salt is invoked from the minion using ``salt-call``, the
            key(s) must be passphraseless. For greater security with
            passphraseless private keys, see the `sshd(8)`_ manpage for
            information on securing the keypair from the remote side in the
            ``authorized_keys`` file.

            .. _`sshd(8)`: http://www.man7.org/linux/man-pages/man8/sshd.8.html#AUTHORIZED_KEYS_FILE_FORMAT

        .. versionchanged:: 2015.8.7

            Salt will no longer attempt to use passphrase-protected keys unless
            invoked from the minion using ``salt-call``, to prevent blocking
            waiting for user input.

        Key can also be specified as a SaltStack file server URL, eg. salt://location/identity_file

        .. versionchanged:: 2016.3.0

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    saltenv
        The default salt environment to pull sls files from

        .. versionadded:: 2016.3.1

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-submodule(1)`: http://git-scm.com/docs/git-submodule

    CLI Example:

    .. code-block:: bash

        # Update submodule and ensure it is initialized (before 2015.8.0)
        salt myminion git.submodule /path/to/repo/sub/repo init=True
        # Update submodule and ensure it is initialized (2015.8.0 and later)
        salt myminion git.submodule /path/to/repo/sub/repo update opts='--init'

        # Rebase submodule (2015.8.0 and later)
        salt myminion git.submodule /path/to/repo/sub/repo update opts='--rebase'

        # Add submodule (2015.8.0 and later)
        salt myminion git.submodule /path/to/repo/sub/repo add opts='https://mydomain.tld/repo.git'

        # Unregister submodule (2015.8.0 and later)
        salt myminion git.submodule /path/to/repo/sub/repo deinit
    uinitu�The 'init' argument is no longer supported. Either set 'command' to 'init', or include '--init' in the 'opts' argument and set 'command' to 'update'.ugitu	submoduleRRRRkRRlRustdout(
RRRRRRRRRRFR"RCR%(
RR+R@R�RRRkRRlRR)tinit_tcmd((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt	submoduleZs&�	c	

@s�t||�}dgt|�}	|	jd�t���|d
k	rrt�fd�dD��rrtd��n|	j��|	j|�|r�|	j|�nt|	d|d|d	|d
|d|�dS(u	
    .. versionadded:: 2015.8.0

    Interface to `git-symbolic-ref(1)`_

    cwd
        The path to the git checkout

    ref
        Symbolic ref to read/modify

    value
        If passed, then the symbolic ref will be set to this value and an empty
        string will be returned.

        If not passed, then the ref to which ``ref`` points will be returned,
        unless ``--delete`` is included in ``opts`` (in which case the symbolic
        ref will be deleted).

    opts
        Any additional options to add to the command line, in a single string

    git_opts
        Any additional options to add to git command itself (not the
        ``symbolic-refs`` subcommand), in a single string. This is useful for
        passing ``-c`` to run git with temporary changes to the git
        configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-symbolic-ref(1)`: http://git-scm.com/docs/git-symbolic-ref

    CLI Examples:

    .. code-block:: bash

        # Get ref to which HEAD is pointing
        salt myminion git.symbolic_ref /path/to/repo HEAD
        # Set/overwrite symbolic ref 'FOO' to local branch 'foo'
        salt myminion git.symbolic_ref /path/to/repo FOO refs/heads/foo
        # Delete symbolic ref 'FOO'
        salt myminion git.symbolic_ref /path/to/repo FOO opts='--delete'
    ugitusymbolic-refc3@s|]}|�kVqdS(N((R�R�(R@(s4/usr/lib/python2.7/site-packages/salt/modules/git.pys	<genexpr>Osu-du--deleteuGValue cannot be set for symbolic ref if -d/--delete is included in optsRRRRRustdoutN(u-du--delete(	RRFR$RCRR�RR"R%(
RRR�R@R�RRRRR+((R@s4/usr/lib/python2.7/site-packages/salt/modules/git.pytsymbolic_ref�s"S
(

	c

C@s�t||�}dgt|�}
|
jd�gt|�D]}|dkr<|^q<}td�|D��rtd��n|
j|�|
j|�d|kr�d|kr�|
j|�nt|
d	|d
|d|d|d
td|	�dS(u	
    .. versionadded:: 2018.3.4

    Interface to `git-tag(1)`_, adds and removes tags.

    cwd
        The path to the main git checkout or a linked worktree

    name
        Name of the tag

    ref : HEAD
        Which ref to tag (defaults to local clone's HEAD)

        .. note::
            This argument is ignored when either ``-d`` or ``--delete`` is
            present in the ``opts`` passed to this function.

    message
        Optional message to include with the tag. If provided, an annotated tag
        will be created.

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            Additionally, on the Salt CLI, if the opts are preceded with a
            dash, it is necessary to precede them with ``opts=`` (as in the CLI
            examples below) to avoid causing errors with Salt's own argument
            parsing.

    git_opts
        Any additional options to add to git command itself (not the
        ``worktree`` subcommand), in a single string. This is useful for
        passing ``-c`` to run git with temporary changes to the git
        configuration.

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

    .. _`git-tag(1)`: http://git-scm.com/docs/git-tag

    CLI Example:

    .. code-block:: bash

        # Create an non-annotated tag
        salt myminion git.tag /path/to/repo v1.2
        # Create an annotated tag
        salt myminion git.tag /path/to/repo v1.2 message='Version 1.2'
        # Delete the tag
        salt myminion git.tag /path/to/repo v1.2 opts='-d'
    ugitutagu-au
--annotatecs@s'|]}|dkpd|kVqdS(u-mu	--messageN((R�R�((s4/usr/lib/python2.7/site-packages/salt/modules/git.pys	<genexpr>�su5Tag messages must be passed in the "message" argumentu-du--deleteRRRRRTRustdout(u-au
--annotate(	RRFR$RCR�RR"R%R
(
RR�RR�R@R�RRRRR+R�tformatted_opts((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyttag`s$U
+

	cC@s1d}d}|tkr�ytddg�d}Wn)tk
r]}tjd|�d}nXy|j�dt|<Wq�tk
r�tjd	�dt|<q�Xn|s�t|S|tkr)tj|g�}xVt|jd
�D]>}y|jt	|��Wq�t
k
r!|j|�q�Xq�Wnt|S(u
    .. versionadded:: 2015.8.0

    Returns the version of Git installed on the minion

    versioninfo : False
        If ``True``, return the version in a versioninfo list (e.g. ``[2, 5,
        0]``)

    CLI Example:

    .. code-block:: bash

        salt myminion git.version
    ugit.versionugit.versioninfougitu	--versionustdoutu4Failed to obtain the git version (error follows):
%suunknowni����u*Running 'git --version' returned no stdoutu.(R{R%RR[R\R7R?R�R$tintR�(RR~tcontextkey_infoRERvtptrtpart((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyR�s2



cK@s~t�tjjj|�}|jdd�}
|rJtjjj|�nt||�}|
rt|rtt	d��ndgt
|�}|jddg�|r�|r�tj
d�n|jd�nP|
s�tjj|�}
n|j|r�dnd	|
g�|r|jd
�n|jt|��|j|�|rL|j|�nt|d|d|d
|	d|
dtd|�dS(u�

    .. versionadded:: 2015.8.0

    Interface to `git-worktree(1)`_, adds a worktree

    cwd
        The path to the git checkout

    worktree_path
        Path to the new worktree. Can be either absolute, or relative to
        ``cwd``.

    branch
        Name of new branch to create. If omitted, will be set to the basename
        of the ``worktree_path``. For example, if the ``worktree_path`` is
        ``/foo/bar/baz``, then ``branch`` will be ``baz``.

    ref
        Name of the ref on which to base the new worktree. If omitted, then
        ``HEAD`` is use, and a new branch will be created, named for the
        basename of the ``worktree_path``. For example, if the
        ``worktree_path`` is ``/foo/bar/baz`` then a new branch ``baz`` will be
        created, and pointed at ``HEAD``.

    reset_branch : False
        If ``False``, then `git-worktree(1)`_ will fail to create the worktree
        if the targeted branch already exists. Set this argument to ``True`` to
        reset the targeted branch to point at ``ref``, and checkout the
        newly-reset branch into the new worktree.

    force : False
        By default, `git-worktree(1)`_ will not permit the same branch to be
        checked out in more than one worktree. Set this argument to ``True`` to
        override this.

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` to avoid causing errors
            with Salt's own argument parsing.

            All CLI options for adding worktrees as of Git 2.5.0 are already
            supported by this function as of Salt 2015.8.0, so using this
            argument is unnecessary unless new CLI arguments are added to
            `git-worktree(1)`_ and are not yet supported in Salt.

    git_opts
        Any additional options to add to git command itself (not the
        ``worktree`` subcommand), in a single string. This is useful for
        passing ``-c`` to run git with temporary changes to the git
        configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-worktree(1)`: http://git-scm.com/docs/git-worktree

    CLI Examples:

    .. code-block:: bash

        salt myminion git.worktree_add /path/to/repo/main ../hotfix ref=origin/master
        salt myminion git.worktree_add /path/to/repo/main ../hotfix branch=hotfix21 ref=v2.1.9.3
    ubranchu,Only one of 'branch' and 'detach' is allowedugituworktreeuaddu@'force' argument to git.worktree_add is ignored when detach=Trueu--detachu-Bu-bu--forceRRRRRTRustdoutN(RRRRRRRRRRRFR"R[RjR$R.R	R�RCR%R
(Rt
worktree_pathRtreset_branchR�tdetachR@R�RRRRR)tbranch_R+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytworktree_add�s@m

	c
C@s�t�t||�}dgt|�}
|
jddg�|rR|
jd�n|rh|
jd�n|r�|
jd|g�n|
jt|��t|
d|d|d	|d
|d|	�dS(
u�
    .. versionadded:: 2015.8.0

    Interface to `git-worktree(1)`_, prunes stale worktree administrative data
    from the gitdir

    cwd
        The path to the main git checkout or a linked worktree

    dry_run : False
        If ``True``, then this function will report what would have been
        pruned, but no changes will be made.

    verbose : True
        Report all changes made. Set to ``False`` to suppress this output.

    expire
        Only prune unused worktree data older than a specific period of time.
        The date format for this parameter is described in the documentation
        for the ``gc.pruneWorktreesExpire`` config param in the
        `git-config(1)`_ manpage.

    opts
        Any additional options to add to the command line, in a single string

        .. note::
            On the Salt CLI, if the opts are preceded with a dash, it is
            necessary to precede them with ``opts=`` to avoid causing errors
            with Salt's own argument parsing.

            All CLI options for pruning worktrees as of Git 2.5.0 are already
            supported by this function as of Salt 2015.8.0, so using this
            argument is unnecessary unless new CLI arguments are added to
            `git-worktree(1)`_ and are not yet supported in Salt.

    git_opts
        Any additional options to add to git command itself (not the
        ``worktree`` subcommand), in a single string. This is useful for
        passing ``-c`` to run git with temporary changes to the git
        configuration.

        .. versionadded:: 2017.7.0

        .. note::
            This is only supported in git 1.7.2 and newer.

    user
        User under which to run the git command. By default, the command is run
        by the user under which the minion is running.

    password
        Windows only. Required when specifying ``user``. This parameter will be
        ignored on non-Windows platforms.

      .. versionadded:: 2016.3.4

    ignore_retcode : False
        If ``True``, do not log an error to the minion log if the git command
        returns a nonzero exit status.

        .. versionadded:: 2015.8.0

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    .. _`git-worktree(1)`: http://git-scm.com/docs/git-worktree
    .. _`git-config(1)`: http://git-scm.com/docs/git-config/2.5.1

    CLI Examples:

    .. code-block:: bash

        salt myminion git.worktree_prune /path/to/repo
        salt myminion git.worktree_prune /path/to/repo dry_run=True
        salt myminion git.worktree_prune /path/to/repo expire=1.day.ago
    ugituworktreeupruneu	--dry-runu	--verboseu--expireRRRRRustdout(RRRFR"R$RCR%(Rtdry_runtverbosetexpireR@R�RRRRR+((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytworktree_prune�s"_	cC@s�t�t||�}tjj|�s;t|d��n%t|d|�s`t|d��nytjj	j
|�Wn+tk
r�}tdj||���nXt
S(u�
    .. versionadded:: 2015.8.0

    Recursively removes the worktree located at ``cwd``, returning ``True`` if
    successful. This function will attempt to determine if ``cwd`` is actually
    a worktree by invoking :py:func:`git.is_worktree
    <salt.modules.git.is_worktree>`. If the path does not correspond to a
    worktree, then an error will be raised and no action will be taken.

    .. warning::

        There is no undoing this action. Be **VERY** careful before running
        this function.

    cwd
        Path to the worktree to be removed

    user
        Used for path expansion when ``cwd`` is not an absolute path. By
        default, when ``cwd`` is not absolute, the path will be assumed to be
        relative to the home directory of the user under which the minion is
        running. Setting this option will change the home directory from which
        path expansion is performed.

    output_encoding
        Use this option to specify which encoding to use to decode the output
        from any git commands which are run. This should not be needed in most
        cases.

        .. note::
            This should only be needed if the files in the repository were
            created with filenames using an encoding other than UTF-8 to handle
            Unicode characters.

        .. versionadded:: 2018.3.1

    CLI Examples:

    .. code-block:: bash

        salt myminion git.worktree_rm /path/to/worktree
    u does not existRu is not a git worktreeuUnable to remove {0}: {1}(RRR.R	R�RR�RRRWtrm_rft	ExceptionRDR
(RRRRv((s4/usr/lib/python2.7/site-packages/salt/modules/git.pytworktree_rms+(at__doc__t
__future__RRRR�RIR�R.R�R3tsalt.utils.argsRtsalt.utils.datatsalt.utils.filestsalt.utils.functoolstsalt.utils.itertoolstsalt.utils.pathtsalt.utils.platformtsalt.utils.stringutilstsalt.utils.templatestsalt.utils.urltsalt.exceptionsRRtsalt.utils.versionsRRtsalt.extRt	getLoggert__name__R[t__func_alias__RR
RRRR,RR:RCRFROR%RzR�R#R�R�R�R�R�R�R�R�Rt	functoolstalias_functiontconfig_get_regexR�R�R�R�R�R�R�R�R�R�R�RRR	R
RRRRRR#R'RR.R|R0R1R2R6R9R:R<RRERIRL(((s4/usr/lib/python2.7/site-packages/salt/modules/git.pyt<module>s�
	+			 			�U�^h�a^[�|5>�6�tFB7�3�n�Mh�VI��W^Z>TLF�be3�i

Zerion Mini Shell 1.0