mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 17:09:03 +00:00
Merge pull request #10756 from Vye/add_explicit_git_revision_winrepo
added explicit git revision support to winrepo
This commit is contained in:
commit
b08d5916e3
@ -105,9 +105,14 @@ def update_git_repos():
|
||||
#else:
|
||||
#targetname = gitrepo
|
||||
targetname = gitrepo
|
||||
rev = None
|
||||
# If a revision is specified, use it.
|
||||
if len(gitrepo.strip().split(' ')) > 1:
|
||||
rev, gitrepo = gitrepo.strip().split(' ')
|
||||
gittarget = os.path.join(repo, targetname)
|
||||
#result = mminion.states['git.latest'](gitrepo,
|
||||
result = __salt__['git.latest'](gitrepo,
|
||||
rev=rev,
|
||||
target=gittarget,
|
||||
force=True)
|
||||
ret[result['name']] = result['result']
|
||||
|
@ -91,8 +91,13 @@ def update_git_repos():
|
||||
targetname = gitrepo.split('/')[-1]
|
||||
else:
|
||||
targetname = gitrepo
|
||||
rev = None
|
||||
# If a revision is specified, use it.
|
||||
if len(gitrepo.strip().split(' ')) > 1:
|
||||
rev, gitrepo = gitrepo.strip().split(' ')
|
||||
gittarget = os.path.join(repo, targetname)
|
||||
result = mminion.states['git.latest'](gitrepo,
|
||||
rev=rev,
|
||||
target=gittarget,
|
||||
force=True)
|
||||
ret[result['name']] = result['result']
|
||||
|
@ -213,7 +213,7 @@ def latest(name,
|
||||
identity=identity)
|
||||
elif rev:
|
||||
|
||||
cmd = 'git rev-parse {0} ^{{commit}}'.format(rev)
|
||||
cmd = 'git rev-parse {0}'.format(rev)
|
||||
retcode = __salt__['cmd.retcode'](cmd,
|
||||
cwd=target,
|
||||
runas=user)
|
||||
|
Loading…
Reference in New Issue
Block a user