mercurial/narrowspec.py
branchstable
changeset 52718 1c83ebf78f74
parent 52717 a7669e7b0355
--- a/mercurial/narrowspec.py	Fri Jan 10 12:40:42 2025 +0000
+++ b/mercurial/narrowspec.py	Fri Jan 10 16:14:40 2025 +0000
@@ -84,6 +84,11 @@
             _(b'"." and ".." are not allowed in narrowspec paths')
         )
 
+    if pat != b'' and b'' in components:
+        raise error.Abort(
+            _(b'empty path components are not allowed in narrowspec paths')
+        )
+
 
 def normalizepattern(pattern, defaultkind=b'path'):
     """Returns the normalized version of a text-format pattern.