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:
parent
2a987f59d2
commit
434e9e1d8f
1 changed files with 2 additions and 3 deletions
|
@ -455,9 +455,8 @@ def clone(git_path, module, repo, dest, remote, depth, version, bare,
|
||||||
cmd.extend(['--reference', str(reference)])
|
cmd.extend(['--reference', str(reference)])
|
||||||
cmd.extend([repo, dest])
|
cmd.extend([repo, dest])
|
||||||
module.run_command(cmd, check_rc=True, cwd=dest_dirname)
|
module.run_command(cmd, check_rc=True, cwd=dest_dirname)
|
||||||
if bare:
|
if bare and remote != 'origin':
|
||||||
if remote != 'origin':
|
module.run_command([git_path, 'remote', 'add', remote, repo], check_rc=True, cwd=dest)
|
||||||
module.run_command([git_path, 'remote', 'add', remote, repo], check_rc=True, cwd=dest)
|
|
||||||
|
|
||||||
if refspec:
|
if refspec:
|
||||||
cmd = [git_path, 'fetch']
|
cmd = [git_path, 'fetch']
|
||||||
|
|
Loading…
Reference in a new issue