Patchwork D8997: git: make dirstate status() respect matcher

login
register
mail settings
Submitter phabricator
Date Sept. 7, 2020, 9:31 p.m.
Message ID <differential-rev-PHID-DREV-bcc5oruopbispef5bxds-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/47105/
State Superseded
Headers show

Comments

phabricator - Sept. 7, 2020, 9:31 p.m.
durin42 created this revision.
Herald added a reviewer: hg-reviewers.
Herald added a subscriber: mercurial-patches.

REVISION SUMMARY
  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.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8997

AFFECTED FILES
  hgext/git/dirstate.py

CHANGE DETAILS




To: durin42, #hg-reviewers
Cc: mercurial-patches, mercurial-devel

Patch

diff --git a/hgext/git/dirstate.py b/hgext/git/dirstate.py
--- a/hgext/git/dirstate.py
+++ b/hgext/git/dirstate.py
@@ -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