feat: add shallow fetch and grouped skill selection
This commit is contained in:
@@ -6,7 +6,9 @@ import sys
|
||||
import tempfile
|
||||
import unittest
|
||||
from pathlib import Path
|
||||
from unittest.mock import patch
|
||||
|
||||
from skiff.sources import fetch_source
|
||||
|
||||
REPO_ROOT = Path(__file__).resolve().parents[1]
|
||||
|
||||
@@ -228,6 +230,32 @@ class CustomSourceTests(unittest.TestCase):
|
||||
self.assertTrue((checkout / ".git").is_dir())
|
||||
self.assertTrue((checkout / "skills" / "release-check" / "SKILL.md").is_file())
|
||||
|
||||
def test_git_source_clone_is_shallow(self) -> None:
|
||||
checkout = self.home / "checkout"
|
||||
entry = {
|
||||
"repo": "https://example.test/company-skills.git",
|
||||
"ref": "main",
|
||||
"checkout": str(checkout),
|
||||
}
|
||||
|
||||
with patch("skiff.sources.subprocess.run") as run:
|
||||
fetch_source("company", entry)
|
||||
|
||||
run.assert_called_once_with(
|
||||
[
|
||||
"git",
|
||||
"clone",
|
||||
"--depth",
|
||||
"1",
|
||||
"--branch",
|
||||
"main",
|
||||
"--",
|
||||
"https://example.test/company-skills.git",
|
||||
str(checkout),
|
||||
],
|
||||
check=True,
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user