fix broken environment save/restore when a hook runs.
move "run commend with different env/cwd" code out to function in util.
new function is called esystem.
Is there an error message when trying to diff non-existing files?
found: No such file or directory
not: No such file or directory
Is there an error message when trying to add non-existing files?
found: No such file or directory
not: No such file or directory