Alter rev-parse syntax to support msys git
Alter rev-parse syntax to support msys git

On windows, msys and cygwin versions of git need braces to be escaped when they
are invoked via subprocess.  (This appears to be is a side effect of the machinery
that converts windows paths to posix-like paths for the executable).

If they are not escaped, then "rev^{commit]" becomes a meaningless "rev^commit"
to an msys git, resulting in an error.

In contrast, we do not want to escape the braces if passing "rev^{commit}" to any
other form of git.  We can avoid having to decide whether escaping is needed by
using the alternative notation "^0".

python-poetry/poetry-core,python-poetry/poetry-core,python-poetry/poetry-core