Hmm, looking at this closer, I don't think we were sufficiently quoting it in the first place.

To be sure I need to walk through it, so:

In git prior to 1.9, `git submodule foreach` evaluated its arguments by running:

```sh
eval “$@“
```

and in 1.9+, it does the following:

```sh
if [ $# -eq 1 ]
then
  eval “$@“
else
  “$@“
fi
```

In other words, previously expansion of its arguments was performed  twice, first by the user’s shell, and again by the eval here. But now, if more than one argument is passed, the eval is skipped and the arguments are executed directly without extra expansion.

In the usage here, there was only one expansion, because we bypass the shell and exec git directly.

With git 1.9+, \*nothing* is expanded, since we are hitting the second branch of the conditional above.

But we need `$path` to be expanded here, so we have to pass everything as a single string in order to hit the first branch of the conditional.

—

So tl;dr, I think this is the correct change to make, and since we weren’t doing the quoting right before I think we can merge this as-is.

As a separate change, we should properly quote `dst` before it is interpolated. The `shell_quote` method you mentioned appears to be insufficient (it fails to escape spaces, for example). It would be nice if we could use the `shellwords` library, but I’m not sure about its availability in Ruby versions prior to 1.8.7.