55from pathlib import Path
66from typing import TYPE_CHECKING
77
8- from gitingest .config import DEFAULT_TIMEOUT
98import git
9+
10+ from gitingest .config import DEFAULT_TIMEOUT
1011from gitingest .utils .git_utils import (
1112 _add_token_to_url ,
1213 check_repo_exists ,
1314 checkout_partial_clone ,
14- create_git_auth_header ,
1515 create_git_repo ,
1616 ensure_git_installed ,
1717 is_github_host ,
@@ -97,19 +97,19 @@ async def clone_repo(config: CloneConfig, *, token: str | None = None) -> None:
9797 "no_checkout" : True ,
9898 "depth" : 1 ,
9999 }
100-
100+
101101 if partial_clone :
102102 # GitPython doesn't directly support --filter and --sparse in clone
103103 # We'll need to use git.Git() for the initial clone with these options
104104 git_cmd = git .Git ()
105- cmd_args = ["clone" , " --single-branch" , "--no-checkout" , "--depth=1" ]
105+ cmd_args = ["--single-branch" , "--no-checkout" , "--depth=1" ]
106106 if partial_clone :
107107 cmd_args .extend (["--filter=blob:none" , "--sparse" ])
108108 cmd_args .extend ([clone_url , local_path ])
109- git_cmd .execute ( cmd_args )
109+ git_cmd .clone ( * cmd_args )
110110 else :
111111 git .Repo .clone_from (clone_url , local_path , ** clone_kwargs )
112-
112+
113113 logger .info ("Git clone completed successfully" )
114114 except git .GitCommandError as exc :
115115 msg = f"Git clone failed: { exc } "
@@ -124,7 +124,7 @@ async def clone_repo(config: CloneConfig, *, token: str | None = None) -> None:
124124 # Create repo object and perform operations
125125 try :
126126 repo = create_git_repo (local_path , url , token )
127-
127+
128128 # Ensure the commit is locally available
129129 logger .debug ("Fetching specific commit" , extra = {"commit" : commit })
130130 repo .git .fetch ("--depth=1" , "origin" , commit )
0 commit comments