Fix empty repository crash due to None timestamp comparison (#489)

Empty repositories have None for pushed_at/updated_at, causing a
TypeError when compared to the last_update string. Use .get() with
truthiness check to skip None timestamps in incremental tracking.
This commit is contained in:
Rodos
2026-02-18 20:10:48 +11:00
parent 60067650b0
commit f54a5458f6

View File

@@ -1772,9 +1772,9 @@ def backup_repositories(args, output_directory, repositories):
last_update = "0000-00-00T00:00:00Z"
for repository in repositories:
if "updated_at" in repository and repository["updated_at"] > last_update:
if repository.get("updated_at") and repository["updated_at"] > last_update:
last_update = repository["updated_at"]
elif "pushed_at" in repository and repository["pushed_at"] > last_update:
elif repository.get("pushed_at") and repository["pushed_at"] > last_update:
last_update = repository["pushed_at"]
if repository.get("is_gist"):