X-Git-Url: https://git.madduck.net/etc/vim.git/blobdiff_plain/2c90480e1a102ab0fac57737d2ba5143d82abed7..767604e03f5e454ae5b5c268cd5831c672f46de8:/src/black/__init__.py?ds=inline diff --git a/src/black/__init__.py b/src/black/__init__.py index 86a0b63..ded4a73 100644 --- a/src/black/__init__.py +++ b/src/black/__init__.py @@ -653,6 +653,11 @@ def get_sources( if exclude is None: exclude = re_compile_maybe_verbose(DEFAULT_EXCLUDES) gitignore = get_gitignore(root) + p_gitignore = get_gitignore(p) + # No need to use p's gitignore if it is identical to root's gitignore + # (i.e. root and p point to the same directory). + if gitignore != p_gitignore: + gitignore += p_gitignore else: gitignore = None sources.update(