Skip to content

Commit c7308fb

Browse files
committed
tests(fix[test_sync]) Create non-empty repos in sync fixtures
why: create_git_remote_repo() without post_init creates empty repos (no commits). The new libvcs error handling correctly reports rev-list HEAD failure on empty repos, causing 8 test failures. what: - Import git_remote_repo_single_commit_post_init from libvcs - Pass it as remote_repo_post_init to all create_git_remote_repo() calls - Update uv.lock to include libvcs _all parameter fix
1 parent f035455 commit c7308fb

2 files changed

Lines changed: 11 additions & 4 deletions

File tree

tests/test_sync.py

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import pytest
99
from libvcs._internal.shortcuts import create_project
10+
from libvcs.pytest_plugin import git_remote_repo_single_commit_post_init
1011
from libvcs.sync.git import GitRemote, GitSync
1112

1213
from vcspull._internal.config_reader import ConfigReader
@@ -150,7 +151,9 @@ def test_config_variations(
150151
remote_list: list[str],
151152
) -> None:
152153
"""Test vcspull sync'ing across a variety of configurations."""
153-
dummy_repo = create_git_remote_repo()
154+
dummy_repo = create_git_remote_repo(
155+
remote_repo_post_init=git_remote_repo_single_commit_post_init,
156+
)
154157

155158
config_file = write_config_remote(
156159
config_path=tmp_path / "myrepos.yaml",
@@ -255,10 +258,14 @@ def test_updating_remote(
255258
has_extra_remotes: bool,
256259
) -> None:
257260
"""Verify yaml configuration state is applied and reflected to local VCS clone."""
258-
dummy_repo = create_git_remote_repo()
261+
dummy_repo = create_git_remote_repo(
262+
remote_repo_post_init=git_remote_repo_single_commit_post_init,
263+
)
259264

260265
mirror_name = "mirror_repo"
261-
mirror_repo = create_git_remote_repo()
266+
mirror_repo = create_git_remote_repo(
267+
remote_repo_post_init=git_remote_repo_single_commit_post_init,
268+
)
262269

263270
repo_parent = tmp_path / "study" / "myrepo"
264271
repo_parent.mkdir(parents=True)

uv.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)