Adapt to Git 1.9's `submodule foreach` changes

Closes #26871.

Signed-off-by: Jack Nagel <jacknagel@gmail.com>