mirror of
https://github.com/arcan1s/ahriman.git
synced 2025-06-28 06:41:43 +00:00
perf: limit clone and fetch by the latest commit
This commit is contained in:
@ -56,7 +56,8 @@ def test_fetch_existing(remote_source: RemoteSource, mocker: MockerFixture) -> N
|
||||
local = Path("local")
|
||||
Sources.fetch(local, remote_source)
|
||||
check_output_mock.assert_has_calls([
|
||||
MockCall("git", "fetch", "--quiet", "origin", remote_source.branch, cwd=local, logger=pytest.helpers.anyvar(int)),
|
||||
MockCall("git", "fetch", "--quiet", "--depth", "1", "origin",
|
||||
remote_source.branch, cwd=local, logger=pytest.helpers.anyvar(int)),
|
||||
MockCall("git", "checkout", "--force", remote_source.branch, cwd=local, logger=pytest.helpers.anyvar(int)),
|
||||
MockCall("git", "reset", "--quiet", "--hard", f"origin/{remote_source.branch}",
|
||||
cwd=local, logger=pytest.helpers.anyvar(int)),
|
||||
@ -75,7 +76,7 @@ def test_fetch_new(remote_source: RemoteSource, mocker: MockerFixture) -> None:
|
||||
local = Path("local")
|
||||
Sources.fetch(local, remote_source)
|
||||
check_output_mock.assert_has_calls([
|
||||
MockCall("git", "clone", "--quiet", "--branch", remote_source.branch, "--single-branch",
|
||||
MockCall("git", "clone", "--quiet", "--depth", "1", "--branch", remote_source.branch, "--single-branch",
|
||||
remote_source.git_url, str(local), cwd=local.parent, logger=pytest.helpers.anyvar(int)),
|
||||
MockCall("git", "checkout", "--force", remote_source.branch, cwd=local, logger=pytest.helpers.anyvar(int)),
|
||||
MockCall("git", "reset", "--quiet", "--hard", f"origin/{remote_source.branch}",
|
||||
|
Reference in New Issue
Block a user