We are passing `GitErrorData` to `JSON.stringify` to include in the string
generated by `GitError.toString`. However, we set `replacer` to `[]`, which
means `JSON.stringify` will _always_ serialize to `{ }`. After this change
GitError messages should be more understandable, and not just say `Failed to
execute git`.
If the classic GitHub for Windows (creatively named github.exe) is installed alongside the new GitHub Desktop (which installs a github.bat file to PATH), we can get into the situation where Code can ask the GUI to authenticate for a private repository, which it doesn't understand.
Pass the --path argument to git hash-object so that filters are correctly applied when staging lines. This prevents lines with crlf from being added to files that have autocrlf=true. Old versions of git can complain quite a bit if you get into this state.
From: https://git-scm.com/docs/git-hash-object
```
--path
Hash object as it were located at the given path. The location of file does not directly influence on the hash value, but path is used to determine what Git filters should be applied to the object before it can be placed to the object database, and, as result of applying filters, the actual blob put into the object database may differ from the given file. This option is mainly useful for hashing temporary files located outside of the working directory or files read from stdin.
```
Fixes#21146
**Bug**
Git always uses utf8 encoding for retrieving file contents.
**Fix**
Pass the 'files.encoding' configuration property to the git-extension and use this encoding to decode git output.