5
5
from pathlib import Path
6
6
from typing import TYPE_CHECKING
7
7
8
- from gitingest .config import DEFAULT_TIMEOUT
9
8
import git
9
+
10
+ from gitingest .config import DEFAULT_TIMEOUT
10
11
from gitingest .utils .git_utils import (
11
12
_add_token_to_url ,
12
13
check_repo_exists ,
13
14
checkout_partial_clone ,
14
- create_git_auth_header ,
15
15
create_git_repo ,
16
16
ensure_git_installed ,
17
17
is_github_host ,
@@ -97,19 +97,19 @@ async def clone_repo(config: CloneConfig, *, token: str | None = None) -> None:
97
97
"no_checkout" : True ,
98
98
"depth" : 1 ,
99
99
}
100
-
100
+
101
101
if partial_clone :
102
102
# GitPython doesn't directly support --filter and --sparse in clone
103
103
# We'll need to use git.Git() for the initial clone with these options
104
104
git_cmd = git .Git ()
105
- cmd_args = ["clone" , " --single-branch" , "--no-checkout" , "--depth=1" ]
105
+ cmd_args = ["--single-branch" , "--no-checkout" , "--depth=1" ]
106
106
if partial_clone :
107
107
cmd_args .extend (["--filter=blob:none" , "--sparse" ])
108
108
cmd_args .extend ([clone_url , local_path ])
109
- git_cmd .execute ( cmd_args )
109
+ git_cmd .clone ( * cmd_args )
110
110
else :
111
111
git .Repo .clone_from (clone_url , local_path , ** clone_kwargs )
112
-
112
+
113
113
logger .info ("Git clone completed successfully" )
114
114
except git .GitCommandError as exc :
115
115
msg = f"Git clone failed: { exc } "
@@ -124,7 +124,7 @@ async def clone_repo(config: CloneConfig, *, token: str | None = None) -> None:
124
124
# Create repo object and perform operations
125
125
try :
126
126
repo = create_git_repo (local_path , url , token )
127
-
127
+
128
128
# Ensure the commit is locally available
129
129
logger .debug ("Fetching specific commit" , extra = {"commit" : commit })
130
130
repo .git .fetch ("--depth=1" , "origin" , commit )
0 commit comments