Improve performance of git and mercurial prompt
Improve performance of git and mercurial prompt

This implements custom logic to detect if we're inside of working tree
and skips os calls if not. This will improve performance of prompt
handling, especially for mercurial prompt.

cmderdev/cmder,cmderdev/cmder