Skip to content

Commit d2a7959

Browse files
committed
Fix bare-clone repo name parsing (was splitting on "_" not "__")
bare_clone_repo writes to "{owner}__{name}.git" but mine_bare_repo_to_cache was splitting on a single underscore — leaving an underscore prefix on every name (e.g. FiloSottile/_age, _sunlight, _torchwood). Split on the double underscore separator.
1 parent c02dc89 commit d2a7959

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

generate_stats.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,10 +1328,12 @@ def mine_bare_repo_to_cache(bare: Path) -> int:
13281328
if cf.exists() and cf.stat().st_size > 10:
13291329
return -1 # already mined
13301330
recs = mine_local_repo(bare)
1331-
# The bare-clone file name encodes the canonical full_name.
1331+
# The bare-clone file name encodes the canonical full_name as
1332+
# "{owner}__{name}.git" (see bare_clone_repo). Split on the double
1333+
# underscore — single split would leave a leading "_" on names.
13321334
raw = bare.name.replace(".git", "")
1333-
if "_" in raw:
1334-
owner, name = raw.split("_", 1)
1335+
if "__" in raw:
1336+
owner, name = raw.split("__", 1)
13351337
full = f"{owner}/{name}"
13361338
else:
13371339
full = raw

0 commit comments

Comments
 (0)