summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.rst6
-rw-r--r--coverage/files.py5
2 files changed, 8 insertions, 3 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index a001a9e6..377cabc1 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -20,6 +20,10 @@ development at the same time, such as 4.5.x and 5.0.
Unreleased
----------
+- Fix: with ``relative_files = true``, specifying a specific file to include or
+ omit wouldn't work correctly (`issue 1604`_). This is now fixed, with
+ testing help by `Marc Gibbons <pull 1608_>`_.
+
- Fix: the XML report would have an incorrect ``<source>`` element when using
relative files and the source option ended with a slash (`issue 1541`_).
This is now fixed, thanks to `Kevin Brown-Silva <pull 1608_>`_.
@@ -35,7 +39,9 @@ Unreleased
.. _issue 1523: https://github.com/nedbat/coveragepy/issues/1523
.. _issue 1541: https://github.com/nedbat/coveragepy/issues/1541
+.. _issue 1604: https://github.com/nedbat/coveragepy/issues/1604
.. _pull 1608: https://github.com/nedbat/coveragepy/pull/1608
+.. _pull 1609: https://github.com/nedbat/coveragepy/pull/1609
.. _pull 1610: https://github.com/nedbat/coveragepy/pull/1610
.. _pull 1613: https://github.com/nedbat/coveragepy/pull/1613
diff --git a/coverage/files.py b/coverage/files.py
index 2a117734..925d5772 100644
--- a/coverage/files.py
+++ b/coverage/files.py
@@ -209,9 +209,8 @@ def prep_patterns(patterns: Iterable[str]) -> List[str]:
"""
prepped = []
for p in patterns or []:
- if p.startswith(("*", "?")):
- prepped.append(p)
- else:
+ prepped.append(p)
+ if not p.startswith(("*", "?")):
prepped.append(abs_file(p))
return prepped