mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 17:33:54 +00:00
remove grep and use rev-parse
This commit is contained in:
parent
245f423486
commit
d676f06c25
@ -107,8 +107,7 @@ def current_branch(cwd, user=None):
|
||||
|
||||
salt '*' git.current_branch /path/to/repo
|
||||
'''
|
||||
cmd = r'git branch | grep "^*\ " | cut -d " " -f 2 | ' + \
|
||||
'grep -v "(detached"'
|
||||
cmd = r'git rev-parse --abbrev-ref HEAD'
|
||||
|
||||
return __salt__['cmd.run_stdout'](cmd, cwd=cwd, runas=user)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user