mirror of
https://github.com/saltstack/salt.git
synced 2025-04-17 10:10:20 +00:00
Merge pull request #42663 from StreetHawkInc/fix_git_tag_check
Check remote tags before deciding to do a fetch #42329
This commit is contained in:
commit
4863771428
1 changed files with 17 additions and 0 deletions
|
@ -1317,6 +1317,23 @@ def latest(name,
|
|||
'if it does not already exist).',
|
||||
comments
|
||||
)
|
||||
remote_tags = set([
|
||||
x.replace('refs/tags/', '') for x in __salt__['git.ls_remote'](
|
||||
cwd=target,
|
||||
remote=remote,
|
||||
opts="--tags",
|
||||
user=user,
|
||||
password=password,
|
||||
identity=identity,
|
||||
saltenv=__env__,
|
||||
ignore_retcode=True,
|
||||
).keys() if '^{}' not in x
|
||||
])
|
||||
if set(all_local_tags) != remote_tags:
|
||||
has_remote_rev = False
|
||||
ret['changes']['new_tags'] = list(remote_tags.symmetric_difference(
|
||||
all_local_tags
|
||||
))
|
||||
|
||||
if not has_remote_rev:
|
||||
try:
|
||||
|
|
Loading…
Add table
Reference in a new issue