Commit 1ab87a3f authored by hauntsaninja's avatar hauntsaninja Committed by Jelle Zijlstra
Browse files

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

Fixes #1213
parent 7af619b8
Loading
Loading
Loading
Loading
+1 −1
Changes for black.py: 1 added line, 1 removed line.
Original line number Diff line number Diff line
@@ -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():