remove grep and use rev-parse

This commit is contained in:
Daniel Wallace 2014-08-05 20:04:49 -04:00
parent 245f423486
commit d676f06c25

View File

@ -107,8 +107,7 @@ def current_branch(cwd, user=None):
salt '*' git.current_branch /path/to/repo salt '*' git.current_branch /path/to/repo
''' '''
cmd = r'git branch | grep "^*\ " | cut -d " " -f 2 | ' + \ cmd = r'git rev-parse --abbrev-ref HEAD'
'grep -v "(detached"'
return __salt__['cmd.run_stdout'](cmd, cwd=cwd, runas=user) return __salt__['cmd.run_stdout'](cmd, cwd=cwd, runas=user)