Skip to content

Commit

Permalink
Match include against path with unresolved symlinks
Browse files Browse the repository at this point in the history
  • Loading branch information
sth committed Oct 26, 2023
1 parent 11e6f55 commit 639b819
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/black/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -361,10 +361,6 @@ def gen_python_files(
if normalized_path is None:
continue

normalized_path = "/" + normalized_path
if child.is_dir():
normalized_path += "/"

if child.is_dir():
# If gitignore is None, gitignore usage is disabled, while a Falsey
# gitignore is when the directory doesn't have a .gitignore file.
Expand Down Expand Up @@ -393,7 +389,7 @@ def gen_python_files(
warn=verbose or not quiet
):
continue
include_match = include.search(normalized_path) if include else True
include_match = include.search(root_relative_path) if include else True
if include_match:
yield child

Expand Down

0 comments on commit 639b819

Please sign in to comment.