mercurial/match.py
changeset 33357 a21819f439fe
parent 33319 3c84591e7321
child 33358 38b6122df5c7
--- a/mercurial/match.py	Thu Jul 06 22:20:38 2017 -0700
+++ b/mercurial/match.py	Sun Jul 09 22:53:02 2017 -0700
@@ -797,7 +797,7 @@
     if kind == 'path':
         if pat == '.':
             return ''
-        return '^' + util.re.escape(pat) + '(?:/|$)'
+        return util.re.escape(pat) + '(?:/|$)'
     if kind == 'rootfilesin':
         if pat == '.':
             escaped = ''
@@ -805,7 +805,7 @@
             # Pattern is a directory name.
             escaped = util.re.escape(pat) + '/'
         # Anything after the pattern must be a non-directory.
-        return '^' + escaped + '[^/]+$'
+        return escaped + '[^/]+$'
     if kind == 'relglob':
         return '(?:|.*/)' + _globre(pat) + globsuffix
     if kind == 'relpath':