mercurial/context.py
changeset 31437 084050d76e4f
parent 31388 9e57033fec0c
child 31464 0e7a6279ff6e
--- a/mercurial/context.py	Wed Mar 15 15:11:52 2017 -0700
+++ b/mercurial/context.py	Wed Mar 15 15:33:24 2017 -0700
@@ -300,8 +300,10 @@
 
     def match(self, pats=None, include=None, exclude=None, default='glob',
               listsubrepos=False, badfn=None):
+        if pats is None:
+            pats = []
         r = self._repo
-        return matchmod.match(r.root, r.getcwd(), pats or [],
+        return matchmod.match(r.root, r.getcwd(), pats,
                               include, exclude, default,
                               auditor=r.nofsauditor, ctx=self,
                               listsubrepos=listsubrepos, badfn=badfn)
@@ -1517,16 +1519,18 @@
 
     def match(self, pats=None, include=None, exclude=None, default='glob',
               listsubrepos=False, badfn=None):
+        if pats is None:
+            pats = []
         r = self._repo
 
         # Only a case insensitive filesystem needs magic to translate user input
         # to actual case in the filesystem.
         if not util.fscasesensitive(r.root):
-            return matchmod.icasefsmatcher(r.root, r.getcwd(), pats or [],
+            return matchmod.icasefsmatcher(r.root, r.getcwd(), pats,
                                            include, exclude, default, r.auditor,
                                            self, listsubrepos=listsubrepos,
                                            badfn=badfn)
-        return matchmod.match(r.root, r.getcwd(), pats or [],
+        return matchmod.match(r.root, r.getcwd(), pats,
                               include, exclude, default,
                               auditor=r.auditor, ctx=self,
                               listsubrepos=listsubrepos, badfn=badfn)