.chkbitignore: add wildcard matching

This commit is contained in:
Pascal de Bruijn 2020-01-22 11:24:53 +01:00 committed by Pascal de Bruijn
parent 396feb0f45
commit a32e1bf36f

View File

@ -1,3 +1,4 @@
import fnmatch
import os
import subprocess
import sys
@ -43,7 +44,10 @@ class Index:
return os.path.join(self.path, INDEX)
def should_ignore(self, name):
return name in self.ignore
for ignore in self.ignore:
if fnmatch.fnmatch(name, ignore):
return True
return False
def _setmod(self):
self.modified = True