Skip to content

Commit df88376

Browse files
committed
fix uploading 0 size files
1 parent 0128a06 commit df88376

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

mergin/client_push.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -259,18 +259,19 @@ def create_upload_job(
259259
upload_changes = changes.get_upload_changes()
260260
transaction_id = push_start_resp.get("transaction") if upload_changes else None
261261
job = UploadJob(local_version, changes, transaction_id, mp, mc, tmp_dir)
262+
if not upload_changes:
263+
mp.log.info("not uploading any files")
264+
if push_start_resp:
265+
job.server_resp = push_start_resp
266+
push_project_finalize(job)
267+
return # all done - no pending job
268+
262269

263270
if transaction_id:
264271
mp.log.info(f"got transaction ID {transaction_id}")
265272

266273
# prepare file chunks for upload
267274
upload_queue_items = create_upload_chunks(mc, mp, upload_changes)
268-
if not upload_queue_items:
269-
mp.log.info("not uploading any files")
270-
if push_start_resp:
271-
job.server_resp = push_start_resp
272-
push_project_finalize(job)
273-
return # all done - no pending job
274275

275276
mp.log.info(f"Starting upload chunks for project {project_id}")
276277
job.add_items(upload_queue_items)

0 commit comments

Comments
 (0)