Reject negative retention before modifying stored versions
This commit is contained in:
parent
421960726c
commit
15e4ed81a2
1 changed files with 15 additions and 0 deletions
|
|
@ -65,6 +65,8 @@ class LargeFileBase(ABC):
|
|||
keep_last_n: Optional[int] = None,
|
||||
cache_only_mode: bool = False,
|
||||
):
|
||||
if keep_last_n is not None and keep_last_n < 0:
|
||||
raise ValueError("keep_last_n must be non-negative")
|
||||
clean_name = re.sub(r"[^!a-zA-Z0-9._-]+", "", name)
|
||||
if clean_name != name:
|
||||
raise ValueError(
|
||||
|
|
|
|||
Loading…
Reference in a new issue