1
0
mirror of https://github.com/deadc0de6/dotdrop.git synced 2026-02-15 16:15:05 +00:00

Fix infinite loop when matching ignore patterns

This commit is contained in:
Mo Hyun
2024-10-22 09:20:57 -07:00
committed by deadc0de
parent dc0db530e1
commit d25eae45f4

View File

@@ -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)