mirror of
https://github.com/minetest/contentdb.git
synced 2024-11-10 01:23:48 +01:00
describe_difference: Limit string field diff length
This commit is contained in:
parent
19fa91d319
commit
9738a8a826
@ -109,9 +109,10 @@ def describe_difference(diff: List, available_space: int) -> typing.Optional[str
|
|||||||
after = diff[0]["after"]
|
after = diff[0]["after"]
|
||||||
|
|
||||||
if isinstance(before, str) and isinstance(after, str):
|
if isinstance(before, str) and isinstance(after, str):
|
||||||
|
if len(before) + len(after) <= available_space + 30:
|
||||||
return f"{key}: {before} -> {after}"
|
return f"{key}: {before} -> {after}"
|
||||||
|
|
||||||
if isinstance(before, list) and isinstance(after, list):
|
elif isinstance(before, list) and isinstance(after, list):
|
||||||
removed = []
|
removed = []
|
||||||
added = []
|
added = []
|
||||||
for x in before:
|
for x in before:
|
||||||
|
Loading…
Reference in New Issue
Block a user