saltstack/salt — pull request #18221 by multani (2014-11-18 19:06:50+00:00)
Title: Fix Git's config set with values containing white spaces.

The Salt function `git.config_set` and the state `git.config` (which relies on the former) don't escape the value to be set in the configuration file passed by Salt. For example, this doesn't work:

```
mylocalrepo:
git.config:
- name: user.name
- value: "Jonathan Ballet"
- repo: file://my/path/to/repo
```

This set the `user.name` configuration value to `Jonathan` only.
(Additionally, the state discovers that the value set is not the one specified, and keeps trying to set the right value, which ends up with lot of `name = Jonathan` into the`[user]` section of Git's config file.)

This commit fixes the problem and adds some unit tests to verify it's working properly. The fix is pretty simple yet too simple, and I wonder if there's not something bigger underlying. Since there's no shell quoting at all, it's very to bork anything from this state, this command, or a command written similarly. It looks so obvious that it might be just a design decision though.

I didn't fix the quoting for the name of the setting, since it's not supposed to have space inside. (Or is it?)