Permalink
Browse files

"git checkout" needs to be run as "runas"

Any files created when switching branches were owned by root, which
makes the directory effectively unusable by the intended user.
  • Loading branch information...
1 parent f1230fe commit f57034a936601ec65995d5b3da57e49bbd8ca25b @blast-hardcheese committed Jul 6, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 salt/states/git.py
View
@@ -66,7 +66,7 @@ def latest(name,
('Repository {0} update is probably required (current '
'revision is {1})').format(target, current_rev))
if rev:
- __salt__['git.checkout'](target, rev)
+ __salt__['git.checkout'](target, rev, user=runas)
__salt__['git.pull'](target, user=runas)
new_rev = __salt__['git.revision'](cwd=target, user=runas)
if current_rev != new_rev:
@@ -101,7 +101,7 @@ def latest(name,
if not os.path.isdir(target):
return _fail(ret, result)
if rev:
- __salt__['git.checkout'](target, rev)
+ __salt__['git.checkout'](target, rev, user=runas)
else:
message = 'Repository {0} cloned to {1}'.format(name, target)
log.info(message)

0 comments on commit f57034a

Please sign in to comment.