git.py: Make is_dir() work for submodule directories
Change is_dir()
to use git rev-parse --is-inside-work-tree
. This
is better than the prior implementation because 1) git
should know
best what is a git checkout and it works for submodules directories
(which the old implementation did not).
The revised implementation is different than the old one when it comes
to a directory below the root of a git checkout. The new
implementation will return True where the old would return False.
Added a test case for passing a non-git checkout to is_dir()
.