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