MCPcopy Index your code
hub / github.com/pre-commit/pre-commit / clone

Method clone

pre_commit/store.py:195–210  ·  view source on GitHub ↗

Clone the given url and checkout the specific ref.

(self, repo: str, ref: str, deps: Sequence[str] = ())

Source from the content-addressed store, hash-verified

193 )
194
195 def clone(self, repo: str, ref: str, deps: Sequence[str] = ()) -> str:
196 """Clone the given url and checkout the specific ref."""
197
198 def clone_strategy(directory: str) -> None:
199 git.init_repo(directory, repo)
200 env = git.no_git_env()
201
202 def _git_cmd(*args: str) -> None:
203 cmd_output_b('git', *args, cwd=directory, env=env)
204
205 try:
206 self._shallow_clone(ref, _git_cmd)
207 except CalledProcessError:
208 self._complete_clone(ref, _git_cmd)
209
210 return self._new_repo(repo, ref, deps, clone_strategy)
211
212 def make_local(self, deps: Sequence[str]) -> str:
213 return self._new_repo(

Calls 1

_new_repoMethod · 0.95