Add example to git.latest_branch

This commit is contained in:
Pedro Algarvio 2013-09-21 11:11:51 +01:00
parent 979d548d3a
commit 15ceed965a

View File

@ -114,6 +114,12 @@ def _check_git():
def current_branch(cwd, user=None):
'''
Returns the current branch name, if on a branch.
CLI Example:
.. code-block:: bash
salt '*' git.current_branch /path/to/repo
'''
cmd = 'git branch --list | grep "^*\ " | cut -d " " -f 2 | ' + \
'grep -v "(detached"'