This is a massive test function with steps dependent on each other.
These log messages make it easier to look through the log file to
troubleshoot failures.
Additionally, take measures to ensure that we chdir back to the original
cwd at the conclusion of the test.
A redundant test has also been removed, was likely a stray copypasta.
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.