It looks like Git uses /bin/sh as interpreter when executing script snippets through git submodule foreach '...'. Is there any way to change this, e.g. to convince git to use bin/bash instead?
I'm not looking for the obvious solution, i.e. to just enclose the script snippet into an extra bash -c '...', because that quickly ends up in quoting hell, because both git submodule foreach and bash -c should have the script snipped passed to them being enclosed in single quotes.