ls/ls-url: do not show entry with size<=0 for a directory (#10687)

ls/ls-url: do not show size=0 when the entry is a directory
This commit is contained in:
skshetry
2025-02-09 12:16:53 +05:45
committed by GitHub
parent 25d2638a57
commit 1d6ea68133
+1 -1
View File
@@ -28,7 +28,7 @@ def _format_entry(entry, name, with_size=True, with_hash=False):
ret = []
if with_size:
size = entry.get("size")
if size is None:
if size is None or (size <= 0 and entry.get("isdir")):
size = ""
else:
size = naturalsize(size)