diff --git a/salt/states/git.py b/salt/states/git.py index 247e64ae1965..2f748d7b2301 100644 --- a/salt/states/git.py +++ b/salt/states/git.py @@ -70,9 +70,11 @@ def latest(name, ret, ('Repository {0} update is probably required (current ' 'revision is {1})').format(target, current_rev)) + + __salt__['git.pull'](target, user=runas) + if rev: __salt__['git.checkout'](target, rev, user=runas) - __salt__['git.pull'](target, user=runas) if submodules: __salt__['git.submodule'](target, user=runas)