Merge pull request #29681 from clinta/git-mirror

fix bare/mirror in git.latest
This commit is contained in:
Mike Place 2015-12-15 11:37:16 -07:00
commit 3c427e82bf

View file

@ -104,7 +104,7 @@ def _uptodate(ret, target, comments=None):
# Shouldn't be making any changes if the repo was up to date, but
# report on them so we are alerted to potential problems with our
# logic.
ret['comment'] += '\n\nChanges made: ' + comments
ret['comment'] += '\n\nChanges made: ' + str(comments)
return ret
@ -475,6 +475,7 @@ def latest(name,
if bare:
remote_rev = None
remote_rev_type = None
else:
if rev == 'HEAD':
if 'HEAD' in all_remote_refs:
@ -555,7 +556,7 @@ def latest(name,
all_local_tags = __salt__['git.list_tags'](target, user=user)
local_rev, local_branch = _get_local_rev_and_branch(target, user)
if remote_rev is None and local_rev is not None:
if not bare and remote_rev is None and local_rev is not None:
return _fail(
ret,
'Remote repository is empty, cannot update from a '