format-code: fix for 'git worktree' model

Some developers use `git worktree` to avoid having separate clones
of their source repo.  When working in that model, `.git` is not a
directory but a file with some magic content in it that tells git
how to find the original source repo and branch.  Just check for the
existence of a `.git` (file or directory) rather than requiring it to
explicitly be a directory.

Signed-off-by: Patrick Williams <patrick@stwcx.xyz>
Change-Id: I90d01894cab38493d464da47d1ce32b5da467857
1 file changed