fix rebase

This commit is contained in:
2026-02-10 02:13:35 +02:00
parent 47eaec7027
commit a4fc515370
4 changed files with 4 additions and 15 deletions

View File

@@ -125,7 +125,7 @@ class ArchiveTree(LazyLogging):
if root.exists():
return
with self.paths.preserve_owner(self.paths.archive):
with self.paths.preserve_owner():
root.mkdir(0o755, parents=True)
# init empty repository here
Repo(self.repository_id.name, self.paths, self.sign_args, root).init()

View File

@@ -61,6 +61,7 @@ __all__ = [
"safe_filename",
"srcinfo_property",
"srcinfo_property_list",
"symlink_relative",
"trim_package",
"utcnow",
"walk",

View File

@@ -117,7 +117,7 @@ def test_tree_create(archive_tree: ArchiveTree, mocker: MockerFixture) -> None:
init_mock = mocker.patch("ahriman.core.alpm.repo.Repo.init")
archive_tree.tree_create()
owner_guard_mock.assert_called_once_with(archive_tree.paths.archive)
owner_guard_mock.assert_called_once_with()
mkdir_mock.assert_called_once_with(0o755, parents=True)
init_mock.assert_called_once_with()

View File

@@ -203,7 +203,7 @@ def test_archive_for_create_tree(repository_paths: RepositoryPaths, package_ahri
mkdir_mock = mocker.patch("pathlib.Path.mkdir")
repository_paths.archive_for(package_ahriman.base)
owner_mock.assert_called_once_with(repository_paths.archive)
owner_mock.assert_called_once_with()
mkdir_mock.assert_called_once_with(mode=0o755, parents=True)
@@ -265,18 +265,6 @@ def test_preserve_owner_non_root(tmp_path: Path, repository_id: RepositoryId, mo
setegid_mock.assert_not_called()
def test_preserve_owner_no_directory(tmp_path: Path, repository_id: RepositoryId, mocker: MockerFixture) -> None:
"""
must skip directory scan if it does not exist
"""
repository_paths = RepositoryPaths(tmp_path, repository_id)
chown_mock = mocker.patch("ahriman.models.repository_paths.RepositoryPaths._chown")
with repository_paths.preserve_owner(Path("empty")):
(repository_paths.root / "created1").touch()
chown_mock.assert_not_called()
def test_tree_clear(repository_paths: RepositoryPaths, package_ahriman: Package, mocker: MockerFixture) -> None:
"""
must remove any package related files