git: remove redundant error checking (#86937)

* remove redundant error checking that makes bad error message

Co-authored-by: Sloane Hertel <19572925+s-hertel@users.noreply.github.com>
pull/86936/head
simonLeary42 6 days ago committed by GitHub
parent c1d7cf45f6
commit 5a4f60dc03
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -0,0 +1,2 @@
bugfixes:
- git - remove redundant error checks after `run_command(check_rc=True)`

@ -994,9 +994,6 @@ def submodules_fetch(git_path, module, remote, track_submodules, dest):
begin = get_submodule_versions(git_path, module, dest)
cmd = [git_path, 'submodule', 'foreach', git_path, 'fetch']
(rc, out, err) = module.run_command(cmd, check_rc=True, cwd=dest)
if rc != 0:
module.fail_json(msg="Failed to fetch submodules: %s" % out + err)
if track_submodules:
# Compare each submodule against its configured remote branch
after = {}
@ -1017,8 +1014,6 @@ def submodules_fetch(git_path, module, remote, track_submodules, dest):
# Compare against the superproject's expectation
cmd = [git_path, 'submodule', 'status']
(rc, out, err) = module.run_command(cmd, check_rc=True, cwd=dest)
if rc != 0:
module.fail_json(msg='Failed to retrieve submodule status: %s' % out + err)
for line in out.splitlines():
if line[0] != ' ':
changed = True

Loading…
Cancel
Save