Skip to content
Permalink
Browse files

find_project_root: allow .git to be a file (#1217)

Fixes #1213
  • Loading branch information
hauntsaninja authored and JelleZijlstra committed Jan 2, 2020
1 parent 7af619b commit 1ab87a3f67bc80a2e59be2692f2e2f25dd143af7
Showing with 1 addition and 1 deletion.
  1. +1 −1 black.py
@@ -3597,7 +3597,7 @@ def find_project_root(srcs: Iterable[str]) -> Path:
# Append a fake file so `parents` below returns `common_base_dir`, too.
common_base /= "fake-file"
for directory in common_base.parents:
if (directory / ".git").is_dir():
if (directory / ".git").exists():
return directory

if (directory / ".hg").is_dir():

0 comments on commit 1ab87a3

Please sign in to comment.
You can’t perform that action at this time.