1
0
Fork 0
mirror of https://github.com/ansible-collections/community.general.git synced 2024-09-14 20:13:21 +02:00

Un-nest nested if statements (#19190)

Easier and clearer to write

if a and b:
    foo()

than

if a:
    if b:
        foo()
This commit is contained in:
Kevin Burke 2017-10-13 05:32:59 -07:00 committed by ansibot
parent 2a987f59d2
commit 434e9e1d8f

View file

@ -455,9 +455,8 @@ def clone(git_path, module, repo, dest, remote, depth, version, bare,
cmd.extend(['--reference', str(reference)])
cmd.extend([repo, dest])
module.run_command(cmd, check_rc=True, cwd=dest_dirname)
if bare:
if remote != 'origin':
module.run_command([git_path, 'remote', 'add', remote, repo], check_rc=True, cwd=dest)
if bare and remote != 'origin':
module.run_command([git_path, 'remote', 'add', remote, repo], check_rc=True, cwd=dest)
if refspec:
cmd = [git_path, 'fetch']