From 434e9e1d8f62ba49daa2f720956e048e336b3c9c Mon Sep 17 00:00:00 2001 From: Kevin Burke Date: Fri, 13 Oct 2017 05:32:59 -0700 Subject: [PATCH] Un-nest nested if statements (#19190) Easier and clearer to write if a and b: foo() than if a: if b: foo() --- lib/ansible/modules/source_control/git.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/lib/ansible/modules/source_control/git.py b/lib/ansible/modules/source_control/git.py index 49943311ff..6aeed62559 100644 --- a/lib/ansible/modules/source_control/git.py +++ b/lib/ansible/modules/source_control/git.py @@ -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']