changeset 43221:0e2a2fab4b2e

fix: remove a never-true check for unset pattern in Fixer.affects() We don't create an instance of a Fixer if the pattern is None, so we don't need to check that in affects(). Differential Revision: https://phab.mercurial-scm.org/D7086
author Martin von Zweigbergk <martinvonz@google.com>
date Sat, 12 Oct 2019 15:12:54 -0700
parents d3d1a3afe7aa
children 8f89899a5446
files hgext/fix.py
diffstat 1 files changed, 1 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/hgext/fix.py	Fri Jul 26 08:43:57 2019 -0700
+++ b/hgext/fix.py	Sat Oct 12 15:12:54 2019 -0700
@@ -843,9 +843,7 @@
 
     def affects(self, opts, fixctx, path):
         """Should this fixer run on the file at the given path and context?"""
-        return self._pattern is not None and scmutil.match(
-            fixctx, [self._pattern], opts
-        )(path)
+        return scmutil.match(fixctx, [self._pattern], opts)(path)
 
     def shouldoutputmetadata(self):
         """Should the stdout of this fixer start with JSON and a null byte?"""