mirror of
https://github.com/valitydev/salt.git
synced 2024-11-07 00:55:19 +00:00
Fix: prevent git.latest from removing target
Fixes #25229 While force=True and test=True git.latest should not remove the target directory.
This commit is contained in:
parent
ad8456eeed
commit
df85d734bc
@ -353,6 +353,13 @@ def latest(name,
|
||||
if os.path.isdir(target):
|
||||
# git clone is required, target exists but force is turned on
|
||||
if force:
|
||||
if __opts__['test']:
|
||||
return _neutral_test(
|
||||
ret,
|
||||
'Repository {0} is about to be cloned to {1}.'
|
||||
'Since force option is in use, deleting.'.format(
|
||||
name, target))
|
||||
|
||||
log.debug(('target {0} found, but not a git repository. Since '
|
||||
'force option is in use, deleting.').format(target))
|
||||
if os.path.islink(target):
|
||||
|
Loading…
Reference in New Issue
Block a user