The check has two issues:
- If a new submodule is added,
commits will be empty and the check will fail with:
subprocess.CalledProcessError: Command '['git', 'ls-tree', '']' returned non-zero exit status 128.
- The check will only run once, even if there are more than one changed submodule directory.
#2 fixes these issues.