mirror of
https://github.com/deadc0de6/dotdrop.git
synced 2026-02-15 13:20:05 +00:00
Fix infinite loop when matching ignore patterns
This commit is contained in:
@@ -19,6 +19,7 @@ import json
|
|||||||
import sys
|
import sys
|
||||||
import requests
|
import requests
|
||||||
from packaging import version
|
from packaging import version
|
||||||
|
from pathlib import PurePath
|
||||||
|
|
||||||
# local import
|
# local import
|
||||||
from dotdrop.logger import Logger
|
from dotdrop.logger import Logger
|
||||||
@@ -231,7 +232,7 @@ def _match_ignore_pattern(path, pattern, debug=False):
|
|||||||
be able to match pattern like "*/dir"
|
be able to match pattern like "*/dir"
|
||||||
"""
|
"""
|
||||||
subpath = path
|
subpath = path
|
||||||
while subpath != os.path.sep:
|
while subpath != PurePath(path).anchor:
|
||||||
# if debug:
|
# if debug:
|
||||||
# msg = f'fnmatch \"{subpath}\" against {pattern}'
|
# msg = f'fnmatch \"{subpath}\" against {pattern}'
|
||||||
# LOG.dbg(msg, force=True)
|
# LOG.dbg(msg, force=True)
|
||||||
|
|||||||
Reference in New Issue
Block a user