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>
This commit is contained in:
simonLeary42
2026-05-20 07:49:00 -04:00
committed by GitHub
co-authored by Sloane Hertel
parent c1d7cf45f6
commit 5a4f60dc03
2 changed files with 2 additions and 5 deletions
@@ -0,0 +1,2 @@
bugfixes:
- git - remove redundant error checks after `run_command(check_rc=True)`
-5
View File
@@ -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