Skip to content

Commit 4bfb6a2

Browse files
committed
repo.py: remove alternates-reading branch from git_essential_directories()
Reference clones are being removed from 2.5 entirely, so objects/info/alternates will never exist and this branch is permanently dead. The now-unused suppress import goes with it. Jira: CMK-33523 Change-Id: Id9b0deee14f202d27e02b7fcba250750851ec5ee
1 parent e580628 commit 4bfb6a2

1 file changed

Lines changed: 0 additions & 10 deletions

File tree

tests/testlib/common/repo.py

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
import subprocess
1515
import sys
1616
from collections.abc import Callable
17-
from contextlib import suppress
1817
from functools import cache
1918
from pathlib import Path
2019

@@ -168,15 +167,6 @@ def git_essential_directories(checkout_dir: Path) -> list[str]:
168167
if not common_dir.is_relative_to(checkout_dir):
169168
essential_dirs.append(common_dir.as_posix())
170169

171-
# In case of reference clones we also need to access them.
172-
# Not sure if 'objects/info/alternates' can contain more than one line and if we really need
173-
# the parent, but at least this one is working for us
174-
with suppress(FileNotFoundError):
175-
with (common_dir / "objects/info/alternates").open() as alternates:
176-
for alternate in (Path(line).parent for line in alternates):
177-
if not alternate.is_relative_to(checkout_dir):
178-
essential_dirs.append(alternate.as_posix())
179-
180170
return essential_dirs
181171

182172

0 commit comments

Comments
 (0)