git: make dirstate status() respect matcher
authorAugie Fackler <raf@durin42.com>
Mon, 07 Sep 2020 17:13:45 -0400
changeset 45421 0c6b2cc9a7bb
parent 45420 c67529569643
child 45422 601e3658216d
git: make dirstate status() respect matcher As with other changes in this stack, we appear to have been getting lucky in the past. An upcoming change behaved _very_ oddly without this fix. Differential Revision: https://phab.mercurial-scm.org/D8997
hgext/git/dirstate.py
--- a/hgext/git/dirstate.py	Mon Sep 07 17:12:29 2020 -0400
+++ b/hgext/git/dirstate.py	Mon Sep 07 17:13:45 2020 -0400
@@ -142,6 +142,8 @@
         gstatus = self.git.status()
         for path, status in gstatus.items():
             path = pycompat.fsencode(path)
+            if not match(path):
+                continue
             if status == pygit2.GIT_STATUS_IGNORED:
                 if path.endswith(b'/'):
                     continue