Skip to content

Commit

Permalink
use commandline git to clone repo
Browse files Browse the repository at this point in the history
  • Loading branch information
hannob committed Dec 15, 2024
1 parent fb07e3b commit c38b0c3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion gitkeyfinder
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import argparse
import logging
import os
import shutil
import subprocess
import tempfile
import urllib

Expand Down Expand Up @@ -42,7 +43,10 @@ print(f"Looking for keys in {args.repo}")

if "://" in args.repo:
logging.info("Cloning repo %s", args.repo)
rep = pygit2.clone_repository(args.repo, tmpdir)
# Call git directly, as cloning with libgit2/pygit2 is
# very slow: https://github.com/libgit2/libgit2/issues/4674
subprocess.check_output(["git", "clone", args.repo, tmpdir])
rep = pygit2.Repository(tmpdir)
up = urllib.parse.urlparse(args.repo)
host = up.hostname
if up.hostname in shortd:
Expand Down

0 comments on commit c38b0c3

Please sign in to comment.