Skip to content

Commit 08b3c23

Browse files
committed
Fix parsing uncommitted packs
1 parent 08e47a6 commit 08b3c23

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

indexer/src/models.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import re
22
import os
33
import json
4+
import time
45
import hashlib
56
import logging
67
import pathlib
@@ -305,12 +306,12 @@ def parse(self, packpath: str) -> Pack:
305306
[*get_file_date, "--", targz_file],
306307
cwd=pack_set,
307308
)
308-
pack.stats.updated = int(updated)
309+
pack.stats.updated = int(updated if updated else time.time())
309310
added = subprocess.check_output(
310311
[*get_file_date, "--diff-filter=A", "--follow", "--", targz_file],
311312
cwd=pack_set,
312313
)
313-
pack.stats.added = int(added)
314+
pack.stats.added = int(added if added else time.time())
314315

315316
for file in (pack_set / "download").iterdir():
316317
if file.name.startswith(".") or not file.is_file():

0 commit comments

Comments
 (0)