mirror of
https://github.com/valitydev/salt.git
synced 2024-11-08 09:23:56 +00:00
remove grep and use rev-parse
This commit is contained in:
parent
e2488e1969
commit
dba8cb6148
@ -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