@@ -666,7 +666,7 @@ def manifest_complete_commit_ranges(
666666def mark_commit_stream_complete (
667667 repo : str ,
668668 manifest : Manifest ,
669- manifest_lock : threading .Lock ,
669+ manifest_lock : threading .Lock | None ,
670670 complete_ranges : Sequence [tuple [int , int ]],
671671) -> dict :
672672 """Persist aggregate completion proven by the plan and exact range coverage.
@@ -701,8 +701,11 @@ def mark_commit_stream_complete(
701701 "n_records" : n_records ,
702702 "range_count" : len (complete_ranges ),
703703 }
704- with manifest_lock :
704+ if manifest_lock is None :
705705 manifest .mark_done (f"{ repo } ::commits" , info )
706+ else :
707+ with manifest_lock :
708+ manifest .mark_done (f"{ repo } ::commits" , info )
706709 return info
707710
708711
@@ -1341,6 +1344,7 @@ def should_stage_repo_from_manifest(
13411344 manifest : Manifest ,
13421345 range_size : int ,
13431346 only_repos : set [str ] | None ,
1347+ manifest_lock : threading .Lock | None = None ,
13441348) -> bool :
13451349 """Return False when the manifest proves this repo needs no extraction.
13461350
@@ -1356,10 +1360,20 @@ def should_stage_repo_from_manifest(
13561360 return False
13571361
13581362 code_needed = streams in {"both" , "code" } and not manifest .is_done (code_key (repo ))
1359- commits_needed = (
1360- streams in {"both" , "commits" }
1361- and manifest_complete_commit_ranges (repo , manifest , range_size ) is None
1362- )
1363+ commits_needed = False
1364+ if streams in {"both" , "commits" }:
1365+ complete_ranges = manifest_complete_commit_ranges (repo , manifest , range_size )
1366+ commits_needed = complete_ranges is None
1367+ if complete_ranges is not None :
1368+ # This callback can skip extraction entirely, so reconcile the
1369+ # derived aggregate sentinel here instead of waiting for
1370+ # run_commits_half, which will never be called for this repo.
1371+ mark_commit_stream_complete (
1372+ repo ,
1373+ manifest ,
1374+ manifest_lock ,
1375+ complete_ranges ,
1376+ )
13631377 return code_needed or commits_needed
13641378
13651379
@@ -3047,6 +3061,7 @@ def should_process(repo: str) -> bool:
30473061 manifest = manifest ,
30483062 range_size = args .range_size ,
30493063 only_repos = only_repos ,
3064+ manifest_lock = manifest_lock ,
30503065 )
30513066 if should_stage :
30523067 ensure_min_free_disk (
0 commit comments