From 2b35f3108572242d3321b227d98f72e5a63998e0 Mon Sep 17 00:00:00 2001 From: cpburnz Date: Tue, 28 Jan 2020 21:39:22 -0500 Subject: [PATCH] Address #31 --- .gitignore | 2 ++ CHANGES.rst | 8 ++++++++ pathspec/__init__.py | 7 ++++--- pathspec/util.py | 4 ++-- 4 files changed, 16 insertions(+), 5 deletions(-) diff --git a/.gitignore b/.gitignore index f70c7a7..2325aef 100644 --- a/.gitignore +++ b/.gitignore @@ -36,3 +36,5 @@ pip-log.txt # Sublime Text file. *.sublime-project *.sublime-workspace + +*.iml diff --git a/CHANGES.rst b/CHANGES.rst index 880a000..8072bcb 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -3,6 +3,14 @@ Change History ============== +0.8.0 (TDB) +----------- + +- `Issue #31`_: match_tree doesn't return symlink. + +.. _`Issue #31`: https://github.com/cpburnz/python-path-specification/issues/31 + + 0.7.0 (2019-12-27) ------------------ diff --git a/pathspec/__init__.py b/pathspec/__init__.py index dd73189..72c5b31 100644 --- a/pathspec/__init__.py +++ b/pathspec/__init__.py @@ -24,7 +24,7 @@ from __future__ import unicode_literals __author__ = "Caleb P. Burns" -__copyright__ = "Copyright © 2013-2018 Caleb P. Burns" +__copyright__ = "Copyright © 2013-2020 Caleb P. Burns" __created__ = "2013-10-12" __credits__ = [ "dahlia ", @@ -46,13 +46,14 @@ "mroutis ", "jdufresne ", "groodt ", + "ftrofin ", ] __email__ = "cpburnz@gmail.com" __license__ = "MPL 2.0" __project__ = "pathspec" __status__ = "Development" -__updated__ = "2019-12-27" -__version__ = "0.7.0" +__updated__ = "2020-01-28" +__version__ = "0.8.0.dev1" from .pathspec import PathSpec from .pattern import Pattern, RegexPattern diff --git a/pathspec/util.py b/pathspec/util.py index daaf68b..098a6fa 100644 --- a/pathspec/util.py +++ b/pathspec/util.py @@ -114,8 +114,8 @@ def _iter_tree_next(root_full, dir_rel, memo, on_error, follow_links): for file_rel in _iter_tree_next(root_full, node_rel, memo, on_error, follow_links): yield file_rel - elif stat.S_ISREG(node_stat.st_mode): - # Child node is a file, yield it. + elif stat.S_ISREG(node_stat.st_mode) or is_link: + # Child node is a file or unfollowed link, yield it. yield node_rel # NOTE: Make sure to remove the canonical (real) path of the directory