Coverage for src / repo_sync_kitty / commands / sync.py: 87%

13 statements  

« prev     ^ index     » next       coverage.py v7.13.0, created at 2025-12-23 09:31 -0500

1"""Sync command: clone missing repos, fetch/pull existing.""" 

2 

3from pathlib import Path 

4from typing import Annotated 

5 

6import typer 

7from rich.console import Console 

8 

9console = Console() 

10 

11 

12def sync( 

13 manifest: Annotated[ 

14 Path | None, 

15 typer.Option("--manifest", "-m", help="Path to manifest.toml file"), 

16 ] = None, 

17 fetch_only: Annotated[ 

18 bool, 

19 typer.Option("--fetch-only", help="Only fetch, don't clone or pull"), 

20 ] = False, 

21 clone_only: Annotated[ 

22 bool, 

23 typer.Option("--clone-only", help="Only clone missing repos"), 

24 ] = False, 

25 pull: Annotated[ 

26 bool, 

27 typer.Option("--pull", help="Pull changes after fetch (if safe)"), 

28 ] = False, 

29 dry_run: Annotated[ 

30 bool, 

31 typer.Option("--dry-run", "-n", help="Show what would be done"), 

32 ] = False, 

33) -> None: 

34 """Clone missing repos, fetch updates, and optionally pull.""" 

35 console.print("[yellow]sync command not yet implemented[/yellow]") 

36 if manifest: 36 ↛ 37line 36 didn't jump to line 37 because the condition on line 36 was never true

37 console.print(f" manifest: {manifest}") 

38 console.print(f" fetch_only: {fetch_only}") 

39 console.print(f" clone_only: {clone_only}") 

40 console.print(f" pull: {pull}") 

41 console.print(f" dry_run: {dry_run}")